fix [use hasattr("cv2", "name") ,but first param is 'character string',

resulting in an error in the judgment condition]
pull/25079/head
刘雄康 9 months ago
parent d792086ba6
commit ba483dfbb8
  1. 2
      modules/python/package/cv2/__init__.py

@ -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…
Cancel
Save