System Information
OpenCV python version: 4.9.0,and 5.x branch, The latest version
Operating System / Platform: win10
Python version: 3.11.5
Detailed description
on opencv\modules\python\package\cv2_init_.py
use hasattr("cv2", "name") ,but first param is 'character string',
resulting in an error in the judgment condition


Steps to reproduce
no more information
Issue submission checklist