summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Reynwar <ben@reynwar.net>2013-06-14 08:41:21 -0700
committerBen Reynwar <ben@reynwar.net>2013-06-14 08:41:21 -0700
commit1d453860e9407f112169b05e592efca76799124f (patch)
tree79493a10eb2f0dbfa642e0d2520d3b57660d8c24
parent72776a40ae93c785dc527dd7ba0204716cc45b1a (diff)
uninstalled import: Adding overlooked exception handling around imports.
-rw-r--r--gr-fec/python/fec/__init__.py7
-rw-r--r--gr-qtgui/swig/__init__.py28
-rw-r--r--gr-uhd/python/uhd/__init__.py7
-rw-r--r--gr-wxgui/python/wxgui/__init__.py7
4 files changed, 18 insertions, 31 deletions
diff --git a/gr-fec/python/fec/__init__.py b/gr-fec/python/fec/__init__.py
index 05e75ea39a..ecf3dbe8e0 100644
--- a/gr-fec/python/fec/__init__.py
+++ b/gr-fec/python/fec/__init__.py
@@ -23,4 +23,9 @@
Blocks for forward error correction.
'''
-from fec_swig import *
+try:
+ from fec_swig import *
+except ImportError:
+ dirname, filename = os.path.split(os.path.abspath(__file__))
+ __path__.append(os.path.join(dirname, "..", "..", "swig"))
+ from fec_swig import *
diff --git a/gr-qtgui/swig/__init__.py b/gr-qtgui/swig/__init__.py
deleted file mode 100644
index 8f3fca0f4a..0000000000
--- a/gr-qtgui/swig/__init__.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# Copyright 2011 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-#
-
-# The presence of this file turns this directory into a Python package
-
-'''
-Provides a GUI interface using the Qt backend.
-'''
-
-from qtgui_swig import *
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)
diff --git a/gr-wxgui/python/wxgui/__init__.py b/gr-wxgui/python/wxgui/__init__.py
index dd81647fe9..4b99dee9d9 100644
--- a/gr-wxgui/python/wxgui/__init__.py
+++ b/gr-wxgui/python/wxgui/__init__.py
@@ -23,4 +23,9 @@
Provides a GUI interface using the Wx backend.
'''
-from wxgui_swig import *
+try:
+ from wxgui_swig import *
+except ImportError:
+ dirname, filename = os.path.split(os.path.abspath(__file__))
+ __path__.append(os.path.join(dirname, "..", "..", "swig"))
+ from wxgui_swig import *