@ -248,15 +248,6 @@ def get_coverage_path(args, version, interpreter):
shutil . copytree ( src , os . path . join ( coverage_path , ' coverage ' ) )
shutil . copytree ( src , os . path . join ( coverage_path , ' coverage ' ) )
shutil . copy ( ' .coveragerc ' , os . path . join ( coverage_path , ' coverage ' , ' .coveragerc ' ) )
shutil . copy ( ' .coveragerc ' , os . path . join ( coverage_path , ' coverage ' , ' .coveragerc ' ) )
injector = os . path . join ( coverage_path , ' coverage ' , ' injector.py ' )
with open ( injector , ' r+ ' ) as injector_fd :
code = injector_fd . read ( )
code = re . sub ( r ' ^#!.* ' , ' #! %s ' % interpreter , code , count = 1 )
injector_fd . seek ( 0 )
injector_fd . write ( code )
injector_fd . truncate ( )
for root , dir_names , file_names in os . walk ( coverage_path ) :
for root , dir_names , file_names in os . walk ( coverage_path ) :
for name in dir_names + file_names :
for name in dir_names + file_names :
os . chmod ( os . path . join ( root , name ) , stat . S_IRWXU | stat . S_IRGRP | stat . S_IXGRP | stat . S_IROTH | stat . S_IXOTH )
os . chmod ( os . path . join ( root , name ) , stat . S_IRWXU | stat . S_IRGRP | stat . S_IXGRP | stat . S_IROTH | stat . S_IXOTH )
@ -265,6 +256,8 @@ def get_coverage_path(args, version, interpreter):
os . mkdir ( os . path . join ( coverage_path , directory ) )
os . mkdir ( os . path . join ( coverage_path , directory ) )
os . chmod ( os . path . join ( coverage_path , directory ) , stat . S_IRWXU | stat . S_IRWXG | stat . S_IRWXO )
os . chmod ( os . path . join ( coverage_path , directory ) , stat . S_IRWXU | stat . S_IRWXG | stat . S_IRWXO )
os . symlink ( interpreter , os . path . join ( coverage_path , ' coverage ' , ' python ' ) )
if not COVERAGE_PATHS :
if not COVERAGE_PATHS :
atexit . register ( cleanup_coverage_dirs )
atexit . register ( cleanup_coverage_dirs )