add support for setuptools
authorKali Kaneko <kali@leap.se>
Thu, 14 Mar 2013 01:04:24 +0000 (10:04 +0900)
committerKali Kaneko <kali@leap.se>
Thu, 14 Mar 2013 01:04:24 +0000 (10:04 +0900)
src/leap/__init__.py

index 3ad9513..f48ad10 100644 (file)
@@ -1,2 +1,6 @@
-from pkgutil import extend_path
-__path__ = extend_path(__path__, __name__)
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)