def matches_filename(self, config_filename, glob): """Return True if section glob matches filename""" config_dirname = normpath(dirname(config_filename)).replace(sep, '/') glob = glob.replace("\\#", "#") glob = glob.replace("\\;", ";") if '/' in glob: if glob.find('/') == 0: glob = glob[1:] glob = posixpath.join(config_dirname, glob) else: glob = posixpath.join('**/', glob) return fnmatch(self.filename, glob)