@@ -378,8 +378,7 @@ def _classify_installed_files_override(
378
378
print ("Copying files from CMake output" )
379
379
380
380
# lines for a proper work using pylint and an autocomplete in IDE
381
- with open ("%spython/cv2/__init__.py"
382
- % cmake_install_dir , 'r' ) as opencv_init :
381
+ with open (os .path .join (cmake_install_dir , "python" , "cv2" , "__init__.py" ), 'r' ) as opencv_init :
383
382
opencv_init_lines = opencv_init .readlines ()
384
383
extra_imports = ('\n from .cv2 import *\n from .cv2 import _registerMatType\n from . import mat_wrapper\n from . import gapi'
385
384
'\n from . import misc\n from . import utils\n from . import data\n ' )
@@ -390,8 +389,7 @@ def _classify_installed_files_override(
390
389
opencv_init_replacement = line .replace ('importlib.import_module("cv2")' , 'importlib.import_module("cv2.cv2")' )
391
390
opencv_init_data = opencv_init_data + opencv_init_replacement
392
391
393
- with open ("%spython/cv2/__init__.py"
394
- % cmake_install_dir , 'w' ) as opencv_final_init :
392
+ with open (os .path .join (cmake_install_dir , "python" , "cv2" , "__init__.py" ), 'w' ) as opencv_final_init :
395
393
opencv_final_init .write (opencv_init_data )
396
394
397
395
# add lines from the old __init__.py file to the config file
0 commit comments