@@ -1439,6 +1439,7 @@ def _first_stage():
14391439 if os .uname ()[0 ]== 'Darwin' and os .uname ()[2 ][:2 ]in '2021' and sys .version [:3 ]== '2.7' :os .environ ['PYTHON_LAUNCHED_FROM_WRAPPER' ]= '1'
14401440 os .environ ['ARGV0' ]= sys .executable
14411441 os .execl (sys .executable ,sys .executable + '(mitogen:CONTEXT_NAME)' )
1442+ signal .alarm (5 )
14421443 os .write (1 ,'MITO000\n ' .encode ())
14431444 C = '' .encode ()
14441445 while PREAMBLE_COMPRESSED_LEN - len (C )and select .select ([0 ],[],[]):C += os .read (0 ,PREAMBLE_COMPRESSED_LEN - len (C ))
@@ -1479,11 +1480,11 @@ def get_boot_command(self):
14791480 # Just enough to decode, decompress, and exec the first stage.
14801481 # Priorities: wider compatibility, faster startup, shorter length.
14811482 # `sys.path=...` for https://github.com/python/cpython/issues/115911.
1482- # `import os,select ` here (not stage 1) to save a few bytes overall.
1483+ # `import os,... ` here (not stage 1) saves a few bytes overall.
14831484 return self .get_python_argv () + [
14841485 '-c' ,
14851486 'import sys;sys.path=[p for p in sys.path if p];'
1486- 'import binascii,os,select,zlib;'
1487+ 'import binascii,os,select,signal, zlib;'
14871488 'exec(zlib.decompress(binascii.a2b_base64("%s")))' % (encoded .decode (),),
14881489 ]
14891490
0 commit comments