Only import win32api on Windows.
This commit is contained in:
parent
a00a17a224
commit
474b0f499f
@ -1,10 +1,10 @@
|
||||
import os
|
||||
import sys
|
||||
import win32api
|
||||
|
||||
|
||||
def getUserFilesDirectory():
|
||||
if sys.platform == "win32":
|
||||
import win32api
|
||||
# On Windows, sys.executable is codepage-encoded.
|
||||
# It cannot represent all possible filenames, so get the exe filename
|
||||
# using this wide-character API, which returns a `unicode`
|
||||
|
Reference in New Issue
Block a user