summaryrefslogtreecommitdiff
path: root/gi/__init__.py
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-07-12 08:40:27 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-07-12 08:40:31 +0900
commit8e71f268f3e991f68355f535b399cc8cb51fc95d (patch)
tree25009f8fe0fd468c5e5f8e32aa6e8ad03d914a3c /gi/__init__.py
parent9e05f0b92b0d6cde13d729955af7b911f79ba833 (diff)
downloadpygobject2-8e71f268f3e991f68355f535b399cc8cb51fc95d.tar.gz
pygobject2-8e71f268f3e991f68355f535b399cc8cb51fc95d.tar.bz2
pygobject2-8e71f268f3e991f68355f535b399cc8cb51fc95d.zip
Imported Upstream version 3.11.5
Change-Id: I5b5a3e71a92ea82cb98feb0c11f00c68804188dc Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'gi/__init__.py')
-rw-r--r--gi/__init__.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/gi/__init__.py b/gi/__init__.py
index 0645d44..7c1a279 100644
--- a/gi/__init__.py
+++ b/gi/__init__.py
@@ -24,24 +24,27 @@ from __future__ import absolute_import
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
+import sys
+import os
+
+# we can't have pygobject 2 loaded at the same time we load the internal _gobject
+if 'gobject' in sys.modules:
+ raise ImportError('When using gi.repository you must not import static '
+ 'modules like "gobject". Please change all occurrences '
+ 'of "import gobject" to "from gi.repository import GObject".')
+
+from ._gi import _gobject
from ._gi import _API
from ._gi import Repository
from ._gi import PyGIDeprecationWarning
-# Force loading the GObject typelib so we have available the wrappers for
-# base classes such as GInitiallyUnowned
-import gi._gobject
-gi # pyflakes
-
_API = _API # pyflakes
PyGIDeprecationWarning = PyGIDeprecationWarning
-import os
-
_versions = {}
_overridesdir = os.path.join(os.path.dirname(__file__), 'overrides')
-version_info = gi._gobject.pygobject_version[:]
+version_info = _gobject.pygobject_version[:]
__version__ = "{0}.{1}.{2}".format(*version_info)