Skip to content

Commit 3140bce

Browse files
committed
update import behaviour
1 parent 01cf0c2 commit 3140bce

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Diff for: cv2/__init__.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import sys
22
import os
3+
import importlib
34

4-
# FFMPEG dll is not found on Windows without this
5+
# FFmpeg dll is not found on Windows without this
56
os.environ["PATH"] += os.pathsep + os.path.dirname(os.path.realpath(__file__))
67

7-
from . import cv2
8-
sys.modules['cv2'] = cv2
8+
# make IDE's (PyCharm) autocompletion happy
9+
from .cv2 import *
10+
11+
# wildcard import above does not import "private" variables like __version__
12+
# this makes them available
13+
globals().update(importlib.import_module('cv2.cv2').__dict__)

0 commit comments

Comments
 (0)