[Zope3-checkins] SVN: Zope3/trunk/src/zope/component/ do not try to
split path information along ':',
since that doesn't work under Windows
Wolfgang Schnerring
wosc at wosc.de
Wed Sep 27 10:11:01 EDT 2006
Log message for revision 70399:
do not try to split path information along ':', since that doesn't work under Windows
Changed:
U Zope3/trunk/src/zope/component/standalonetests.py
U Zope3/trunk/src/zope/component/tests.py
-=-
Modified: Zope3/trunk/src/zope/component/standalonetests.py
===================================================================
--- Zope3/trunk/src/zope/component/standalonetests.py 2006-09-27 13:48:47 UTC (rev 70398)
+++ Zope3/trunk/src/zope/component/standalonetests.py 2006-09-27 14:11:00 UTC (rev 70399)
@@ -1,9 +1,10 @@
import unittest
import doctest
import sys
+import pickle
if __name__ == "__main__":
- sys.path[:] = sys.argv.pop().split(':')
+ sys.path = pickle.loads(sys.stdin.read())
from zope import interface
from zope.component.testing import setUp, tearDown
Modified: Zope3/trunk/src/zope/component/tests.py
===================================================================
--- Zope3/trunk/src/zope/component/tests.py 2006-09-27 13:48:47 UTC (rev 70398)
+++ Zope3/trunk/src/zope/component/tests.py 2006-09-27 14:11:00 UTC (rev 70399)
@@ -958,16 +958,21 @@
import os
import StringIO
import tempfile
+ import pickle
+
executable = os.path.abspath(sys.executable)
program = os.path.join(os.path.dirname(__file__), 'standalonetests.py')
- paths = ':'.join(p for p in sys.path if p)
- command = "%(executable)s %(program)s %(paths)s" % {
- 'executable': executable, 'program': program, 'paths': paths}
- t = tempfile.TemporaryFile()
- res = subprocess.call([executable, program, paths], stdout=t, stderr=t)
- t.seek(0)
- lines = t.readlines()
- t.close()
+ process = subprocess.Popen([executable, program],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ stdin=subprocess.PIPE)
+
+ pickle.dump(sys.path, process.stdin)
+ process.stdin.close()
+
+ process.wait()
+ lines = process.stdout.readlines()
+ process.stdout.close()
for l in reversed(lines):
l = l.strip()
if l:
More information about the Zope3-Checkins
mailing list