Set cwd when testing import of module

This commit is contained in:
Cédric Krier committed 2009-10-10 13:44:21 +02:00
1 parent 3a7daa0609
commit 2295a854ee
1 file changed
+3 -1
+3 -1
View File
@@ -51,7 +51,9 @@ def monitor():
if os.path.splitext(path)[1] in ['.pyc', '.pyo', '.pyd']:
path = path[:-1]
if _modified(path):
if subprocess.call((sys.executable, '-c', 'import %s' % module)):
if subprocess.call((sys.executable, '-c', 'import %s' % module),
cwd=os.path.dirname(os.path.abspath(os.path.normpath(
os.path.join(__file__, '..'))))):
modified = False
break
modified = True