mirror of
https://github.com/quantum5/punyverse.git
synced 2025-04-24 05:01:57 -04:00
Fix python 2 on linux.
This commit is contained in:
parent
2705dff909
commit
2baeaa5752
|
@ -272,7 +272,7 @@ def load_model(path):
|
|||
if not os.path.isabs(path):
|
||||
path = os.path.join(model_base, path)
|
||||
if not isinstance(path, unicode):
|
||||
path = path.decode('mbcs')
|
||||
path = path.decode('mbcs' if os.name == 'nt' else 'utf8')
|
||||
return WavefrontObject(path)
|
||||
|
||||
@cython.nonecheck(False)
|
||||
|
|
|
@ -247,7 +247,7 @@ class Applet(pyglet.window.Window):
|
|||
with os.fdopen(fd, 'wb') as file:
|
||||
image.save(file, 'BMP')
|
||||
if isinstance(filename, six.binary_type):
|
||||
filename = filename.decode('mbcs')
|
||||
filename = filename.decode('mbcs' if os.name == 'nt' else 'utf8')
|
||||
image = windll.user32.LoadImageW(None, filename, 0, 0, 0, 0x10)
|
||||
windll.user32.OpenClipboard(self._hwnd)
|
||||
windll.user32.EmptyClipboard()
|
||||
|
|
|
@ -241,7 +241,7 @@ def load_model(path):
|
|||
if not os.path.isabs(path):
|
||||
path = os.path.join(model_base, path)
|
||||
if isinstance(path, six.binary_type):
|
||||
path = path.decode('mbcs')
|
||||
path = path.decode('mbcs' if os.name == 'nt' else 'utf8')
|
||||
return WavefrontObject(path)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue