parent
ee1747fcb4
commit
45a9aa536f
|
@ -5,6 +5,7 @@ import traceback
|
||||||
import atexit
|
import atexit
|
||||||
import weakref
|
import weakref
|
||||||
import __future__
|
import __future__
|
||||||
|
import sys
|
||||||
|
|
||||||
# note that the whole code of this module (as well as some
|
# note that the whole code of this module (as well as some
|
||||||
# other modules) execute not only on the local side but
|
# other modules) execute not only on the local side but
|
||||||
|
@ -23,6 +24,13 @@ if 'ThreadOut' not in globals():
|
||||||
from py.__.execnet.message import Message
|
from py.__.execnet.message import Message
|
||||||
ThreadOut = py._thread.ThreadOut
|
ThreadOut = py._thread.ThreadOut
|
||||||
|
|
||||||
|
if sys.version_info > (3, 0):
|
||||||
|
exec """def do_exec(co, loc):
|
||||||
|
exec(co, loc)"""
|
||||||
|
else:
|
||||||
|
exec """def do_exec(co, loc):
|
||||||
|
exec co in loc"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
debug = 0 # open('/tmp/execnet-debug-%d' % os.getpid() , 'wa')
|
debug = 0 # open('/tmp/execnet-debug-%d' % os.getpid() , 'wa')
|
||||||
|
|
||||||
|
@ -237,7 +245,7 @@ class Gateway(object):
|
||||||
try:
|
try:
|
||||||
co = compile(source+'\n', '', 'exec',
|
co = compile(source+'\n', '', 'exec',
|
||||||
__future__.CO_GENERATOR_ALLOWED)
|
__future__.CO_GENERATOR_ALLOWED)
|
||||||
py.test.exec_(co, loc)
|
do_exec(co, loc)
|
||||||
finally:
|
finally:
|
||||||
close()
|
close()
|
||||||
self._trace("execution finished:", repr(source)[:50])
|
self._trace("execution finished:", repr(source)[:50])
|
||||||
|
|
|
@ -30,7 +30,7 @@ if sys.version_info > (3, 0):
|
||||||
exec(source, locs)""")
|
exec(source, locs)""")
|
||||||
else:
|
else:
|
||||||
exec("""def exec_(source, locs):
|
exec("""def exec_(source, locs):
|
||||||
exec source, locs""")
|
exec source in locs""")
|
||||||
|
|
||||||
def exec_from_one_connection(serversock):
|
def exec_from_one_connection(serversock):
|
||||||
print_(progname, 'Entering Accept loop', serversock.getsockname())
|
print_(progname, 'Entering Accept loop', serversock.getsockname())
|
||||||
|
|
Loading…
Reference in New Issue