1
1
# Copyright 2019-2020, Jorj McKie, mailto:<jorj.x.mckie@outlook.de>
2
- # Copyright 2019-2020 , Orsiris de Jong, mailto:<ozy@netpower.fr>
2
+ # Copyright 2019-2021 , Orsiris de Jong, mailto:<ozy@netpower.fr>
3
3
#
4
4
# Part of "Nuitka", an optimizing Python compiler that is compatible and
5
5
# integrates with CPython, but also works on its own.
@@ -86,11 +86,12 @@ def get_checklist(full_name):
86
86
"""
87
87
if not full_name : # guard against nonsense
88
88
return []
89
- checklist = [full_name ] # full name is always looked up first
89
+ checklist = [full_name . asString (), full_name . asString () + '.*' ] # full name is always looked up first
90
90
m0 = ""
91
91
while True : # generate *-import names
92
92
pkg , full_name = full_name .splitPackageName ()
93
- if not pkg : break
93
+ if not pkg :
94
+ break
94
95
m = pkg .asString ()
95
96
m0 += "." + m if m0 else m
96
97
checklist .append (m0 + ".*" )
@@ -374,7 +375,7 @@ def onModuleEncounter(self, module_filename, module_name, module_kind):
374
375
self .info (ignore_msg )
375
376
return False , "dropped by plugin " + plugin .plugin_name
376
377
377
- if full_name == "cv2" :
378
+ if full_name . asString () == "cv2" :
378
379
return True , "needed by OpenCV"
379
380
380
381
if str (full_name .getTopLevelPackageName ()).startswith ("pywin" ):
@@ -385,7 +386,7 @@ def onModuleEncounter(self, module_filename, module_name, module_kind):
385
386
if m in checklist :
386
387
return True , "module is hinted to" # ok
387
388
388
- if check_dependents (full_name , self .import_files ) is True :
389
+ if check_dependents (full_name . asString () , self .import_files ) is True :
389
390
return True , "parent of recursed-to module"
390
391
391
392
# next we ask if implicit imports knows our candidate
0 commit comments