diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-06-06 14:06:53 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-06-06 14:06:53 -0300 |
commit | 40bc92dc04aaf35661cf3ba55e1eff565b094fb9 (patch) | |
tree | e99546873a800f823ee9ddc1d8e4f258eb29f927 | |
parent | 735621bbd2fa7ca81c8650a8c74f38066e1f3f08 (diff) | |
download | tuna-40bc92dc04aaf35661cf3ba55e1eff565b094fb9.tar.gz |
procview gui: Load perf globally
Used to work in previous python versions, but since at least 2.6.5 doing
the import in one method and then trying to use perf.something on
another doesn't work:
File "/home/acme/git/tuna/tuna/gui/procview.py", line 317, in perf_init
self.cpu_map = perf.cpu_map()
NameError: global name 'perf' is not defined
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-x | tuna/gui/procview.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tuna/gui/procview.py b/tuna/gui/procview.py index b1f87a3..c2b82b5 100755 --- a/tuna/gui/procview.py +++ b/tuna/gui/procview.py @@ -3,6 +3,10 @@ pygtk.require("2.0") from tuna import tuna, gui import gobject, gtk, procfs, re, schedutils +try: + import perf +except: + pass def N_(s): """gettext_noop""" @@ -215,7 +219,6 @@ class procview: self.evlist = None try: - import perf self.perf_init() except: # No perf, poll /proc baby, poll pass |