File tree 1 file changed +8
-2
lines changed
Filter options
1 file changed +8
-2
lines changed
Original file line number Diff line number Diff line change @@ -395,8 +395,14 @@ def _classify_installed_files_override(
395
395
# add lines from the old __init__.py file to the config file
396
396
with open (os .path .join (os .path .dirname (os .path .abspath (__file__ )), 'scripts' , '__init__.py' ), 'r' ) as custom_init :
397
397
custom_init_data = custom_init .read ()
398
- with open ('%spython/cv2/config-%s.py'
399
- % (cmake_install_dir , sys .version_info [0 ]), 'w' ) as opencv_init_config :
398
+
399
+ # OpenCV generates config with different name for case with PYTHON3_LIMITED_API=ON
400
+ config_py = os .path .join (cmake_install_dir , 'python' , 'cv2' , 'config-%s.%s.py'
401
+ % (sys .version_info [0 ], sys .version_info [1 ]))
402
+ if not os .path .exists (config_py ):
403
+ config_py = os .path .join (cmake_install_dir , 'python' , 'cv2' , 'config-%s.py' % sys .version_info [0 ])
404
+
405
+ with open (config_py , 'w' ) as opencv_init_config :
400
406
opencv_init_config .write (custom_init_data )
401
407
402
408
for package_name , relpaths_re in cls .package_paths_re .items ():
You can’t perform that action at this time.
0 commit comments