def is_dir(info):
 if hasattr(info, u'isdir'):
  return info.isdir()
 else:
  base = os.path.basename(info.filename)
  return (not base)

def is_dir ( info ) : if hasattr ( info , u'isdir' ) : return info . isdir ( ) else : base = os . path . basename ( info . filename ) return ( not base )
tests whether the file descibed in info is a directory .