@@ -87,28 +87,28 @@ def run_micropython(pyb, args, test_file, is_special=False):
87
87
def get (required = False ):
88
88
rv = b''
89
89
while True :
90
- ready = select .select ([primary ], [], [], 0.02 )
91
- if ready [0 ] == [primary ]:
92
- rv += os .read (primary , 1024 )
90
+ ready = select .select ([parent_fd ], [], [], 0.02 )
91
+ if ready [0 ] == [parent_fd ]:
92
+ rv += os .read (parent_fd , 1024 )
93
93
else :
94
94
if not required or rv :
95
95
return rv
96
96
97
97
def send_get (what ):
98
- os .write (primary , what )
98
+ os .write (parent_fd , what )
99
99
return get ()
100
100
101
101
with open (test_file , 'rb' ) as f :
102
102
# instead of: output_mupy = subprocess.check_output(args, stdin=f)
103
- primary , secondary = pty .openpty ()
104
- p = subprocess .Popen (args , stdin = secondary , stdout = secondary ,
103
+ parent_fd , child_fd = pty .openpty ()
104
+ p = subprocess .Popen (args , stdin = child_fd , stdout = child_fd ,
105
105
stderr = subprocess .STDOUT , bufsize = 0 )
106
106
banner = get (True )
107
107
output_mupy = banner + b'' .join (send_get (line ) for line in f )
108
108
send_get (b'\x04 ' ) # exit the REPL, so coverage info is saved
109
109
p .kill ()
110
- os .close (primary )
111
- os .close (secondary )
110
+ os .close (parent_fd )
111
+ os .close (child_fd )
112
112
else :
113
113
output_mupy = subprocess .check_output (args + [test_file ], stderr = subprocess .STDOUT )
114
114
except subprocess .CalledProcessError :
0 commit comments