[yum-git] yum-complete-transaction.py

Seth Vidal skvidal at linux.duke.edu
Mon Sep 15 15:30:32 UTC 2008


 yum-complete-transaction.py |   19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

New commits:
commit a19bf6214c3edcb44ccb92445e06a4e96a0df575
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Mon Sep 15 11:29:41 2008 -0400

    do the same for y-c-t - setup_locale()

diff --git a/yum-complete-transaction.py b/yum-complete-transaction.py
index b35ebc8..13a5d6e 100755
--- a/yum-complete-transaction.py
+++ b/yum-complete-transaction.py
@@ -18,7 +18,7 @@ import sys
 sys.path.insert(0,'/usr/share/yum-cli')
 
 import yum
-from yum.misc import getCacheDir
+from yum.misc import getCacheDir, setup_locale
 
 from cli import *
 from utils import YumUtilBase
@@ -207,22 +207,7 @@ class YumCompleteTransaction(YumUtilBase):
         
     
 if __name__ == '__main__':
-    import locale
-    # This test needs to be before locale.getpreferredencoding() as that
-    # does setlocale(LC_CTYPE, "")
-    try:
-        locale.setlocale(locale.LC_ALL, '')
-    except locale.Error, e:
-        # default to C locale if we get a failure.
-        print >> sys.stderr, 'Failed to set locale, defaulting to C'
-        os.environ['LC_ALL'] = 'C'
-        locale.setlocale(locale.LC_ALL, 'C')
-        
-    if True: # not sys.stdout.isatty():
-        import codecs
-        sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout)
-        sys.stdout.errors = 'replace'
-    
+    setup_locale()
     util = YumCompleteTransaction()
         
        



More information about the Yum-cvs-commits mailing list