1- import os
21import subprocess
32import sys
43import tempfile
109MINOR_VERSIONS = {"3" : "543210" , "2" : "76" }
1110
1211
13- def _find_version (suffix = "" ):
14- name = "python" + suffix
15- executable = py .path .local .sysfind (name )
16- if executable is None :
17- if sys .platform == "win32" and suffix == "3" :
18- for name in ("python31" , "python30" ):
19- executable = py .path .local (rf"c:\\{ name } \python.exe" )
20- if executable .check ():
21- return executable
22- for tail in MINOR_VERSIONS .get (suffix , "" ):
23- path = py .path .local .sysfind (f"{ name } .{ tail } " )
24- if path :
25- return path
26-
27- else :
28- pytest .skip (f"can't find a { name !r} executable" )
29- return executable
30-
31-
32- TEMPDIR = _py2_wrapper = _py3_wrapper = None
12+ TEMPDIR = None
13+ _py3_wrapper = None
3314
3415
3516def setup_module (mod ):
@@ -56,8 +37,8 @@ def dump(self, obj_rep):
5637import sys
5738sys.path.insert(0, %r)
5839import gateway_base as serializer
59- if sys.version_info > (3, 0): # Need binary output
60- sys.stdout = sys.stdout.detach()
40+ # Need binary output
41+ sys.stdout = sys.stdout.detach()
6142sys.stdout.write(serializer.dumps_internal(%s))
6243"""
6344 % (pyimportdir , obj_rep )
@@ -83,8 +64,7 @@ def load(self, data, option_args="__class__"):
8364import sys
8465sys.path.insert(0, %r)
8566import gateway_base as serializer
86- if sys.version_info > (3, 0):
87- sys.stdin = sys.stdin.detach()
67+ sys.stdin = sys.stdin.detach()
8868loader = serializer.Unserializer(sys.stdin)
8969loader.%s
9070obj = loader.load()
0 commit comments