Serhiy Storchaka added the comment:

r'[^\W\d]\w*' doesn't match all valid Python identifiers. It would be more 
correct to write the check as:

    root, ext = os.path.splitext(basename)
    if not (ext == '.py' and root.isidentifier()):
        # valid Python identifiers only
        return None, False

----------
nosy: +serhiy.storchaka
versions: +Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24263>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to