Minor Python 3/encoding fix in the file manager.
parent
f80f271e0c
commit
dbff4f7977
|
@ -13,6 +13,7 @@ import os
|
||||||
import os.path
|
import os.path
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
from sys import platform as _platform
|
from sys import platform as _platform
|
||||||
|
|
||||||
|
@ -90,7 +91,8 @@ def is_folder_hidden(filepath):
|
||||||
if _platform == "win32":
|
if _platform == "win32":
|
||||||
try:
|
try:
|
||||||
attrs = ctypes.windll.kernel32.GetFileAttributesW(
|
attrs = ctypes.windll.kernel32.GetFileAttributesW(
|
||||||
unicode(filepath))
|
unicode(filepath) if sys.version_info[0] < 3 else filepath
|
||||||
|
)
|
||||||
assert attrs != -1
|
assert attrs != -1
|
||||||
result = bool(attrs & 2)
|
result = bool(attrs & 2)
|
||||||
except (AttributeError, AssertionError):
|
except (AttributeError, AssertionError):
|
||||||
|
|
Loading…
Reference in New Issue