summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/python/gnuradio/gr/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-runtime/python/gnuradio/gr/__init__.py')
-rw-r--r--gnuradio-runtime/python/gnuradio/gr/__init__.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/gnuradio-runtime/python/gnuradio/gr/__init__.py b/gnuradio-runtime/python/gnuradio/gr/__init__.py
index 20a8f97f63..94a5c9ec2b 100644
--- a/gnuradio-runtime/python/gnuradio/gr/__init__.py
+++ b/gnuradio-runtime/python/gnuradio/gr/__init__.py
@@ -28,7 +28,18 @@ Core contents.
# This is the main GNU Radio python module.
# We pull the swig output and the other modules into the gnuradio.gr namespace
-from runtime_swig import *
+# If gnuradio is installed then the swig output will be in this directory.
+# Otherwise it will reside in ../../../swig.
+
+import os
+
+try:
+ from runtime_swig import *
+except ImportError:
+ dirname, filename = os.path.split(os.path.abspath(__file__))
+ __path__.append(os.path.join(dirname, "..", "..", "..", "swig"))
+ from runtime_swig import *
+
from exceptions import *
from top_block import *
from hier_block2 import *