Skip to content

Commit 8cb031a

Browse files
committed
Changed a string substitution to os.path.join
1 parent b6e1ec8 commit 8cb031a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

setup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,7 @@ def _classify_installed_files_override(
378378
print("Copying files from CMake output")
379379

380380
# 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:
383382
opencv_init_lines = opencv_init.readlines()
384383
extra_imports = ('\nfrom .cv2 import *\nfrom .cv2 import _registerMatType\nfrom . import mat_wrapper\nfrom . import gapi'
385384
'\nfrom . import misc\nfrom . import utils\nfrom . import data\n')
@@ -390,8 +389,7 @@ def _classify_installed_files_override(
390389
opencv_init_replacement = line.replace('importlib.import_module("cv2")', 'importlib.import_module("cv2.cv2")')
391390
opencv_init_data = opencv_init_data + opencv_init_replacement
392391

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:
395393
opencv_final_init.write(opencv_init_data)
396394

397395
# add lines from the old __init__.py file to the config file

0 commit comments

Comments
 (0)