mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
Merge pull request #25079 from lxk696:4.x
fix [use hasattr("cv2", "name") ,but first param is 'character string',
This commit is contained in:
commit
37e056c06c
@ -33,7 +33,7 @@ def __load_extra_py_code_for_module(base, name, enable_debug_print=False):
|
||||
# Extension doesn't contain extra py code
|
||||
return False
|
||||
|
||||
if not hasattr(base, name):
|
||||
if base in sys.modules and not hasattr(sys.modules[base], name):
|
||||
setattr(sys.modules[base], name, py_module)
|
||||
sys.modules[export_module_name] = py_module
|
||||
# If it is C extension module it is already loaded by cv2 package
|
||||
|
Loading…
Reference in New Issue
Block a user