no need to create a set from a list comprehension, I know it was there but it is a good moment to replace it by

    set('.' + e for e in deny_extensions)