Add a workaround on module import to also work with Quixote custom version

This commit is contained in:
Frédéric Péters 2011-04-30 18:55:35 +02:00
parent 2a1c50c136
commit f9c5ca3a01
1 changed files with 4 additions and 1 deletions

View File

@ -44,7 +44,10 @@ class Payment(object):
def __init__(self, kind, options):
self.kind = kind
sys.path.append(os.path.dirname(__file__))
module_path = __file__
if not os.path.isdir(os.path.realpath(__file__)):
module_path = os.path.dirname(__file__)
sys.path.append(module_path)
try:
module = __import__(kind)
finally: