mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Fix fix_import for the stupid OS that has case-insensitive file names, again.
This commit is contained in:
parent
5feb1fba59
commit
f786decb5e
@ -94,10 +94,11 @@ class FixImport(fixer_base.BaseFix):
|
|||||||
# so can't be a relative import.
|
# so can't be a relative import.
|
||||||
if not exists(join(dirname(base_path), "__init__.py")):
|
if not exists(join(dirname(base_path), "__init__.py")):
|
||||||
return False
|
return False
|
||||||
if isdir(base_path):
|
(path, filename) = split(base_path)
|
||||||
|
if isdir(base_path) and filename in listdir(path):
|
||||||
|
# We use listdir too because of case-insensitivity on Windows
|
||||||
return True
|
return True
|
||||||
for ext in [".py", ".pyc", ".so", ".sl", ".pyd"]:
|
for ext in [".py", ".pyc", ".so", ".sl", ".pyd"]:
|
||||||
(path, filename) = split(base_path)
|
|
||||||
if (filename + ext) in listdir(path):
|
if (filename + ext) in listdir(path):
|
||||||
# We use this instead of os.path.exists because of case-insensitivity
|
# We use this instead of os.path.exists because of case-insensitivity
|
||||||
# on Windows
|
# on Windows
|
||||||
|
Loading…
Reference in New Issue
Block a user