[Pypt-offline-general] SF.net SVN: pypt-offline: [189] trunk/pypt_core.py
Status: Beta
Brought to you by:
riteshsarraf
|
From: <rit...@us...> - 2007-08-17 16:11:57
|
Revision: 189
http://pypt-offline.svn.sourceforge.net/pypt-offline/?rev=189&view=rev
Author: riteshsarraf
Date: 2007-08-17 09:11:59 -0700 (Fri, 17 Aug 2007)
Log Message:
-----------
* If the $LANG environment variable is not set, just don't spit an exception
Modified Paths:
--------------
trunk/pypt_core.py
Modified: trunk/pypt_core.py
===================================================================
--- trunk/pypt_core.py 2007-08-17 14:10:46 UTC (rev 188)
+++ trunk/pypt_core.py 2007-08-17 16:11:59 UTC (rev 189)
@@ -1562,7 +1562,10 @@
# When using locales, we get translation files. But apt doesn't extract the URI properly.
# Once the extraction problem is root-caused, we can fix this easily.
os.environ['__pypt_set_update'] = options.set_update
- old_environ = os.environ['LANG']
+ try:
+ old_environ = os.environ['LANG']
+ except KeyError:
+ old_environ = "C"
os.environ['LANG'] = "C"
log.verbose("Set environment variable for LANG from %s to %s temporarily.\n" % (old_environ, os.environ['LANG']) )
if os.system('/usr/bin/apt-get -qq --print-uris update > $__pypt_set_update') != 0:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|