def py3_path(path):
 if isinstance(path, six.text_type):
  return path
 assert isinstance(path, bytes)
 if six.PY2:
  return path
 return os.fsdecode(path)

def py3_path ( path ) : if isinstance ( path , six . text_type ) : return path assert isinstance ( path , bytes ) if six . PY2 : return path return os . fsdecode ( path )
convert a bytestring path to unicode on python 3 only .