def get_extension(interp, this): path = this.file_name filename = rpath.split(path)[1] name_split = filename.rsplit('.', 1) if len(name_split) == 2: filename, extension = name_split else: extension = '' return interp.space.wrap(extension)
def get_extension(interp, this): path = this.file_name filename = rpath.split(path)[1] return _extension(interp, filename)