File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -82,12 +82,19 @@ def setup_translations():
8282 locale .bindtextdomain ("mirror" , translations_path )
8383 if hasattr (locale , "textdomain" ):
8484 locale .textdomain ("mirror" )
85- gettext .install ("mirror" , translations_path , unicode = True )
85+ if is_python3 ():
86+ gettext .install ("mirror" , translations_path )
87+ else :
88+ gettext .install ("mirror" , translations_path , unicode = True )
8689 except Exception as e :
8790 log .error ("Unable to initialize gettext/locale" )
8891 log .exception (e )
89- import __builtin__
90- __builtin__ .__dict__ ["_" ] = lambda x : x
92+ if is_python3 ():
93+ import builtins
94+ builtins .__dict__ ["_" ] = lambda x : x
95+ else :
96+ import __builtin__
97+ __builtin__ .__dict__ ["_" ] = lambda x : x
9198
9299def resource_filename (module , path ):
93100 return pkg_resources .require (
You can’t perform that action at this time.
0 commit comments