#NEWLINE# def _relpath_posix( path , start = os . path . curdir ) : #NEWLINE# #INDENT# 'Return a relative version of a path' #NEWLINE# if ( not path ) : #NEWLINE# #INDENT# raise ValueError ( 'no path specified' ) #NEWLINE# #UNINDENT# start_list = os . path . abspath ( start ) . split ( os . path . sep ) #NEWLINE# path_list = os . path . abspath ( path ) . split ( os . path . sep ) #NEWLINE# i = len ( os . path . commonprefix ( [ start_list , path_list ] ) ) #NEWLINE# rel_list = ( ( [ os . path . pardir ] * ( len ( start_list ) - i ) ) + path_list [ i : ] ) #NEWLINE# if ( not rel_list ) : #NEWLINE# #INDENT# return os . path . curdir #NEWLINE# #UNINDENT# return os . path . join ( * rel_list )