mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-12 08:56:13 +01:00
python3 compatibility: fix osc-wrapper
the sys reload trick does not work in python 3 and it is not needed, so let's remove that
This commit is contained in:
parent
b787ca2b39
commit
f3b4acfd0a
@ -8,14 +8,18 @@ import sys
|
||||
|
||||
from osc import commandline, babysitter
|
||||
|
||||
try:
|
||||
# this is a hack to make osc work as expected with utf-8 characters,
|
||||
# no matter how site.py is set...
|
||||
reload(sys)
|
||||
loc = locale.getpreferredencoding()
|
||||
if not loc:
|
||||
loc = sys.getpreferredencoding()
|
||||
sys.setdefaultencoding(loc)
|
||||
del sys.setdefaultencoding
|
||||
reload(sys)
|
||||
loc = locale.getpreferredencoding()
|
||||
if not loc:
|
||||
loc = sys.getpreferredencoding()
|
||||
sys.setdefaultencoding(loc)
|
||||
del sys.setdefaultencoding
|
||||
except NameError:
|
||||
#reload, neither setdefaultencoding are in python3
|
||||
pass
|
||||
|
||||
osccli = commandline.Osc()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user