def unsetenv(key):
 try:
  del os.environ[key]
 except:
  pass
 if hasattr(os, u'unsetenv'):
  os.unsetenv(key)

def unsetenv ( key ) : try : del os . environ [ key ] except : pass if hasattr ( os , u'unsetenv' ) : os . unsetenv ( key )
compatibility wrapper for unsetting environment variables .