def _extract_member(self, member, targetpath, pwd):
 if ((targetpath[(-1):] in (os.path.sep, os.path.altsep)) and (len(os.path.splitdrive(targetpath)[1]) > 1)):
  targetpath = targetpath[:(-1)]
 if (member.filename[0] == '/'):
  targetpath = os.path.join(targetpath, member.filename[1:])
 else:
  targetpath = os.path.join(targetpath, member.filename)
 targetpath = os.path.normpath(targetpath)
 upperdirs = os.path.dirname(targetpath)
 if (upperdirs and (not os.path.exists(upperdirs))):
  os.makedirs(upperdirs)
 if (member.filename[(-1)] == '/'):
  if (not os.path.isdir(targetpath)):
   os.mkdir(targetpath)
  return targetpath
 _extract_from_zip(self, member.filename, targetpath)
 return targetpath

def _extract_member ( self , member , targetpath , pwd ) : if ( ( targetpath [ ( - 1 ) : ] in ( os . path . sep , os . path . altsep ) ) and ( len ( os . path . splitdrive ( targetpath ) [ 1 ] ) > 1 ) ) : targetpath = targetpath [ : ( - 1 ) ] if ( member . filename [ 0 ] == '/' ) : targetpath = os . path . join ( targetpath , member . filename [ 1 : ] ) else : targetpath = os . path . join ( targetpath , member . filename ) targetpath = os . path . normpath ( targetpath ) upperdirs = os . path . dirname ( targetpath ) if ( upperdirs and ( not os . path . exists ( upperdirs ) ) ) : os . makedirs ( upperdirs ) if ( member . filename [ ( - 1 ) ] == '/' ) : if ( not os . path . isdir ( targetpath ) ) : os . mkdir ( targetpath ) return targetpath _extract_from_zip ( self , member . filename , targetpath ) return targetpath
for zipfile py2 .