Skip to content

Commit 87e4f4d

Browse files
committed
Changed a string substitution to os.path.join
1 parent 19ed001 commit 87e4f4d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

setup.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -366,15 +366,13 @@ def _classify_installed_files_override(
366366
print("Copying files from CMake output")
367367

368368
# lines for a proper work using pylint and an autocomplete in IDE
369-
with open("%spython/cv2/__init__.py"
370-
% cmake_install_dir, 'r') as opencv_init:
369+
with open(os.path.join(cmake_install_dir, "python", "cv2", "__init__.py"), 'r') as opencv_init:
371370
opencv_init_lines = opencv_init.readlines()
372371
extra_imports = ('\nfrom .cv2 import *\nfrom . import data\n')
373372
free_line_after_imports = 5
374373
opencv_init_lines.insert(free_line_after_imports, extra_imports)
375374

376-
with open("%spython/cv2/__init__.py"
377-
% cmake_install_dir, 'w') as opencv_final_init:
375+
with open(os.path.join(cmake_install_dir, "python", "cv2", "__init__.py"), 'w') as opencv_final_init:
378376
opencv_final_init.writelines(opencv_init_lines)
379377

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

0 commit comments

Comments
 (0)