From 078ee144a0d20857221a3235b4b619c95e1e4c6b Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Mon, 26 May 2014 17:15:52 +0000 Subject: [PATCH] remove filename extraction and stick with directories --- simport/__init__.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/simport/__init__.py b/simport/__init__.py index 49c37ed..7028bc9 100644 --- a/simport/__init__.py +++ b/simport/__init__.py @@ -66,14 +66,10 @@ def _get_module(target): raise MissingModule("Need a module path for %s (%s)" % (namespace, target)) - path = "" - filename = "" - if filepath: - path, filename = os.path.split(filepath) - if path and path not in sys.path: - if not os.path.isdir(path): - raise BadDirectory("No such directory: '%s'" % path) - sys.path.append(path) + if filepath and filepath not in sys.path: + if not os.path.isdir(filepath): + raise BadDirectory("No such directory: '%s'" % filepath) + sys.path.append(filepath) if not class_or_function: raise MissingMethodOrFunction("No Method or Function specified in '%s'" % target)