def convert_path(pathname):
 if (os.sep == '/'):
  return pathname
 if (not pathname):
  return pathname
 if (pathname[0] == '/'):
  raise ValueError(("path '%s' cannot be absolute" % pathname))
 if (pathname[(-1)] == '/'):
  raise ValueError(("path '%s' cannot end with '/'" % pathname))
 paths = pathname.split('/')
 while ('.' in paths):
  paths.remove('.')
 if (not paths):
  return os.curdir
 return os.path.join(*paths)

def convert_path ( pathname ) : if ( os . sep == '/' ) : return pathname if ( not pathname ) : return pathname if ( pathname [ 0 ] == '/' ) : raise ValueError ( ( "path '%s' cannot be absolute" % pathname ) ) if ( pathname [ ( - 1 ) ] == '/' ) : raise ValueError ( ( "path '%s' cannot end with '/'" % pathname ) ) paths = pathname . split ( '/' ) while ( '.' in paths ) : paths . remove ( '.' ) if ( not paths ) : return os . curdir return os . path . join ( * paths )
return pathname as a name that will work on the native filesystem .