diff options
author | Ben Reynwar <ben@reynwar.net> | 2013-06-14 08:41:21 -0700 |
---|---|---|
committer | Ben Reynwar <ben@reynwar.net> | 2013-06-14 08:41:21 -0700 |
commit | 1d453860e9407f112169b05e592efca76799124f (patch) | |
tree | 79493a10eb2f0dbfa642e0d2520d3b57660d8c24 /gr-uhd/python/uhd | |
parent | 72776a40ae93c785dc527dd7ba0204716cc45b1a (diff) |
uninstalled import: Adding overlooked exception handling around imports.
Diffstat (limited to 'gr-uhd/python/uhd')
-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) |