def get_clean_env(extra=None):
 environ = {u'LANG': u'en_US.UTF-8', u'HOME': data_dir(u'home')}
 if (extra is not None):
  environ.update(extra)
 variables = (u'PATH', u'LD_LIBRARY_PATH')
 for var in variables:
  if (var in os.environ):
   environ[var] = os.environ[var]
 if (six.PY2 and (sys.platform == u'win32')):
  return {str(key): str(val) for (key, val) in environ.items()}
 return environ

def get_clean_env ( extra = None ) : environ = { u'LANG' : u'en_US.UTF-8' , u'HOME' : data_dir ( u'home' ) } if ( extra is not None ) : environ . update ( extra ) variables = ( u'PATH' , u'LD_LIBRARY_PATH' ) for var in variables : if ( var in os . environ ) : environ [ var ] = os . environ [ var ] if ( six . PY2 and ( sys . platform == u'win32' ) ) : return { str ( key ) : str ( val ) for ( key , val ) in environ . items ( ) } return environ
returns cleaned up environment for subprocess execution .