Bug 908296 - Catch all exceptions when importing psutil; r=ted
authorGregory Szorc <gps@mozilla.com>
Fri, 23 Aug 2013 10:50:28 -0700
changeset 144130 7be399d00f9a99fa159b27e51811afffb7adbf85
parent 144129 aed22a2d8353218a7ce0fa7d4823aba42689cb3d
child 144131 534e18e202da25e6f32846c190ffb4d259db0b8d
push id25150
push userryanvm@gmail.com
push dateFri, 23 Aug 2013 21:49:29 +0000
treeherdermozilla-central@17143a9a0d83 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs908296
milestone26.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 908296 - Catch all exceptions when importing psutil; r=ted
python/mozbuild/mozbuild/controller/building.py
testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py
--- a/python/mozbuild/mozbuild/controller/building.py
+++ b/python/mozbuild/mozbuild/controller/building.py
@@ -11,23 +11,19 @@ import os
 import sys
 import time
 
 from collections import (
     namedtuple,
     OrderedDict,
 )
 
-# keep in sync with psutil os support, see psutil/__init__.py
-if sys.platform.startswith("freebsd") or sys.platform.startswith("darwin") or sys.platform.startswith("win32") or sys.platform.startswith("linux"):
-    try:
-        import psutil
-    except ImportError:
-        psutil = None
-else:
+try:
+    import psutil
+except Exception:
     psutil = None
 
 from mozsystemmonitor.resourcemonitor import SystemResourceMonitor
 
 from ..base import MozbuildObject
 
 from ..compilation.warnings import (
     WarningsCollector,
--- a/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py
+++ b/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py
@@ -4,17 +4,17 @@
 
 import multiprocessing
 import sys
 import time
 
 # psutil will raise NotImplementedError if the platform is not supported.
 try:
     import psutil
-except (ImportError, NotImplementedError):
+except Exception:
     psutil = None
 
 from collections import (
     OrderedDict,
     namedtuple,
 )
 
 from contextlib import contextmanager