]> git.phdru.name Git - m_lib.git/blobdiff - m_lib/defenc.py
Fix a bug in getting default_encoding
[m_lib.git] / m_lib / defenc.py
index 01d899058295b87c25a91d786fda45ac1a94b40e..edcd80be4b691d94eb51d30b43f4e8c643d3a621 100755 (executable)
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 """Get default encoding
 
-   Written by Oleg Broytman. Copyright (C) 2007, 2008 PhiloSoft Design.
+   Written by Oleg Broytman. Copyright (C) 2007-2016 PhiloSoft Design.
 """
 
 __all__ = ['default_encoding']
@@ -22,7 +22,7 @@ if use_locale:
       print >>sys.stderr, "WARNING:", err
       lcAll = []
 
-   if len(lcAll) == 2:
+   if len(lcAll) == 2 and lcAll[0] is not None:
       default_encoding = lcAll[1]
    else:
       try: