Removing sys.path from cwd after we are done in pow save
@@ -675,7 +675,12 @@ class POW(object):
from functools import wraps
conf = self._conf()
- sys.path.append(os.getcwd())
+ added_cwd = False
+ cwd = os.getcwd()
+ if cwd not in sys.path:
+ sys.path.append(cwd)
+ added_cwd = True
+ try:
m = IM.import_module(module)
provider_not_set = provider is None
if not provider:
@@ -717,6 +722,9 @@ class POW(object):
p(ns)
ns.save(graph=conf['rdf.graph'])
return ns.created_contexts()
+ finally:
+ if added_cwd:
+ sys.path.remove(cwd)
def say(self, subject, property, object):
'''
