mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-26 06:46: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
|
from osc import commandline, babysitter
|
||||||
|
|
||||||
|
try:
|
||||||
# this is a hack to make osc work as expected with utf-8 characters,
|
# this is a hack to make osc work as expected with utf-8 characters,
|
||||||
# no matter how site.py is set...
|
# no matter how site.py is set...
|
||||||
reload(sys)
|
reload(sys)
|
||||||
loc = locale.getpreferredencoding()
|
loc = locale.getpreferredencoding()
|
||||||
if not loc:
|
if not loc:
|
||||||
loc = sys.getpreferredencoding()
|
loc = sys.getpreferredencoding()
|
||||||
sys.setdefaultencoding(loc)
|
sys.setdefaultencoding(loc)
|
||||||
del sys.setdefaultencoding
|
del sys.setdefaultencoding
|
||||||
|
except NameError:
|
||||||
|
#reload, neither setdefaultencoding are in python3
|
||||||
|
pass
|
||||||
|
|
||||||
osccli = commandline.Osc()
|
osccli = commandline.Osc()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user