Browse Source

Don't import packages, just try to find them in sys.path

suites/jessie-proposed-backports
Chris Lawrence 16 years ago
parent
commit
ec15694ac8
  1. 12
      reportbug.py

12
reportbug.py

@ -21,7 +21,7 @@
#
# Version ##VERSION##; see changelog for revision history
#
# $Id: reportbug.py,v 1.34 2006-08-14 06:02:32 lawrencc Exp $
# $Id: reportbug.py,v 1.35 2006-08-15 19:41:36 lawrencc Exp $
VERSION = "reportbug ##VERSION##"
VERSION_NUMBER = "##VERSION##"
@ -45,11 +45,11 @@ PSEUDOHEADERS = ('Package', 'Version', 'Severity', 'File', 'Tags',
VALID_UIS = ['newt', 'text', 'gnome2', 'urwid']
AVAILABLE_UIS = []
for ui in VALID_UIS:
try:
pkg = __import__('reportbug_ui_%s' % ui)
AVAILABLE_UIS.append(ui)
except ImportError:
pass
pkgname = 'reportbug_ui_%s.py' % ui
for d in sys.path:
if os.path.exists(pkgname):
AVAILABLE_UIS.append(ui)
break
UIS = {'text': 'A text-oriented (console) interface',
'urwid': 'A window-based console interface',

Loading…
Cancel
Save