Skip to content

Commit 2e92c6e

Browse files
committed
only call load_source if path is a file
1 parent 6e48015 commit 2e92c6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

java2python/config/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def last(self, key, default=None):
2727
@staticmethod
2828
def load(name):
2929
""" Imports and returns a module from dotted form or filename. """
30-
if path.exists(name):
30+
if path.exists(name) and path.isfile(name):
3131
mod = load_source(str(hash(name)), name)
3232
else:
3333
mod = reduce(getattr, name.split('.')[1:], __import__(name))

0 commit comments

Comments
 (0)