Skip to content

Commit

Permalink
windows-compatible module discovery, fixes #142
Browse files Browse the repository at this point in the history
  • Loading branch information
posativ committed Mar 14, 2013
1 parent 42ee279 commit 8728ceb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions acrylamid/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,13 @@ def find(directories, filterfunc):
yield join(root, fname)

for filename in find(directories, filterfunc):
modname, ext = os.path.splitext(os.path.basename(rchop(filename, '/__init__.py')))
modname, ext = os.path.splitext(os.path.basename(rchop(filename, os.sep + '__init__.py')))
fp, path, descr = imp.find_module(modname, directories)

prefix = commonprefix((PATH, filename))
if prefix:
modname = 'acrylamid.'
modname += rchop(filename[len(prefix):].replace('/', '.'), '.py')
modname += rchop(filename[len(prefix):].replace(os.sep, '.'), '.py')

try:
mod = sys.modules[modname]
Expand Down

0 comments on commit 8728ceb

Please sign in to comment.