Skip to content

Commit

Permalink
Merge pull request #32 from dcowgill/feature-bindir-confusion
Browse files Browse the repository at this point in the history
Avoid confusing modules with executables in bin
  • Loading branch information
timothycrosley committed Sep 16, 2013
2 parents d2d3fb3 + b149be4 commit 288a6fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion isort/isort.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import codecs
import copy
import os
import os.path
from sys import path as PYTHONPATH
from sys import stderr

Expand Down Expand Up @@ -120,7 +121,8 @@ def place_module(self, moduleName):
for prefix in PYTHONPATH:
fixed_module_name = moduleName.replace('.', '/')
base_path = prefix + "/" + fixed_module_name
if os.path.exists(base_path + ".py") or os.path.exists(base_path) or os.path.exists(base_path + ".so"):
if (os.path.exists(base_path + ".py") or os.path.exists(base_path + ".so") or
(os.path.exists(base_path) and os.path.isdir(base_path))):
if "site-packages" in prefix or "dist-packages" in prefix:
return Sections.THIRDPARTY
elif "python2" in prefix.lower() or "python3" in prefix.lower():
Expand Down

0 comments on commit 288a6fd

Please sign in to comment.