def change_root(new_root, pathname):
 if (os.name == 'posix'):
  if (not os.path.isabs(pathname)):
   return os.path.join(new_root, pathname)
  else:
   return os.path.join(new_root, pathname[1:])
 elif (os.name == 'nt'):
  (drive, path) = os.path.splitdrive(pathname)
  if (path[0] == '\\'):
   path = path[1:]
  return os.path.join(new_root, path)
 elif (os.name == 'os2'):
  (drive, path) = os.path.splitdrive(pathname)
  if (path[0] == os.sep):
   path = path[1:]
  return os.path.join(new_root, path)
 else:
  raise DistutilsPlatformError, ("nothing known about platform '%s'" % os.name)

def change_root ( new_root , pathname ) : if ( os . name == 'posix' ) : if ( not os . path . isabs ( pathname ) ) : return os . path . join ( new_root , pathname ) else : return os . path . join ( new_root , pathname [ 1 : ] ) elif ( os . name == 'nt' ) : ( drive , path ) = os . path . splitdrive ( pathname ) if ( path [ 0 ] == '\\' ) : path = path [ 1 : ] return os . path . join ( new_root , path ) elif ( os . name == 'os2' ) : ( drive , path ) = os . path . splitdrive ( pathname ) if ( path [ 0 ] == os . sep ) : path = path [ 1 : ] return os . path . join ( new_root , path ) else : raise DistutilsPlatformError , ( "nothing known about platform '%s'" % os . name )
return pathname with new_root prepended .