parameters: (new_root, pathname)
docstring: Return 'pathname' with 'new_root' prepended.  If 'pathname' is
      relative, this is equivalent to "os.path.join(new_root,pathname)".
      Otherwise, it requires making 'pathname' relative and then joining the
      two, which is tricky on DOS/Windows and Mac OS.
docstring_summary: Return 'pathname' with 'new_root' prepended.  If 'pathname' is
      relative, this is equivalent to "os.path.join(new_root,pathname)".
      Otherwise, it requires making 'pathname' relative and then joining the
      two, which is tricky on DOS/Windows and Mac OS.
docstring_tokens: Return pathname with new_root prepended . If pathname is relative this is equivalent to os . path . join ( new_root pathname ) . Otherwise it requires making pathname relative and then joining the two which is tricky on DOS / Windows and Mac OS .
function: def change_root (new_root, pathname):
      """Return 'pathname' with 'new_root' prepended.  If 'pathname' is
      relative, this is equivalent to "os.path.join(new_root,pathname)".
      Otherwise, it requires making 'pathname' relative and then joining the
      two, which is tricky on DOS/Windows and Mac OS.
      """
      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
function_tokens: 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