diff options
Diffstat (limited to 'gr-uhd/python/uhd/__init__.py')
-rw-r--r-- | gr-uhd/python/uhd/__init__.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gr-uhd/python/uhd/__init__.py b/gr-uhd/python/uhd/__init__.py index 53c0f9ac14..fa181f8091 100644 --- a/gr-uhd/python/uhd/__init__.py +++ b/gr-uhd/python/uhd/__init__.py @@ -29,7 +29,12 @@ line. # Prepare uhd swig module to make it more pythonic ######################################################################## def _prepare_uhd_swig(): - import uhd_swig + try: + import uhd_swig + except ImportError: + dirname, filename = os.path.split(os.path.abspath(__file__)) + __path__.append(os.path.join(dirname, "..", "..", "swig")) + import uhd_swig #some useful typedefs for the user setattr(uhd_swig, 'freq_range_t', uhd_swig.meta_range_t) |