fix inefficient basepath check

This commit is contained in:
Steven Robertson 2020-08-27 19:56:35 -07:00
parent 5215646c8a
commit 19f92a2435
1 changed files with 5 additions and 6 deletions

View File

@ -92,9 +92,9 @@ RLOG = logging.getLogger('mitogen.ctx')
# there are some cases where modules are loaded in memory only, such as
# ansible collections, and the module "filename" is something like __synthetic__
# which doesn't actually exist
SPECIAL_FILE_PATHS = [
"__synthetic__"
]
SPECIAL_FILE_PATHS = {
"__synthetic__",
}
def _stdlib_paths():
@ -198,9 +198,8 @@ def _py_filename(path):
return path
basepath = os.path.basename(path)
for filename in SPECIAL_FILE_PATHS:
if basepath == filename:
return path
if basepath in SPECIAL_FILE_PATHS:
return path
def _get_core_source():