summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola' <g.rodola@gmail.com>2013-03-16 11:44:30 +0000
committerGiampaolo Rodola' <g.rodola@gmail.com>2013-03-16 11:44:30 +0000
commit88b1039f9964683ff905eb21a9777302f556d256 (patch)
tree9584478b59ce75fbe90fae1cb1382f94b6715154
parente9fd59ce9578648942a689c51cc5e040c1122e04 (diff)
parentb3f10de5f035cdd7093f688f5add7a857f9b7a85 (diff)
downloadpsutil-88b1039f9964683ff905eb21a9777302f556d256.tar.gz
merge heads
-rw-r--r--psutil/_psmswindows.py2
-rw-r--r--test/test_psutil.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/psutil/_psmswindows.py b/psutil/_psmswindows.py
index 18ef4032..f640d492 100644
--- a/psutil/_psmswindows.py
+++ b/psutil/_psmswindows.py
@@ -37,7 +37,7 @@ except Exception:
warnings.warn("couldn't determine platform's NUM_CPUS", RuntimeWarning)
try:
BOOT_TIME = _psutil_mswindows.get_system_boot_time()
-except Exception, err:
+except Exception:
BOOT_TIME = None
warnings.warn("couldn't determine platform's BOOT_TIME", RuntimeWarning)
try:
diff --git a/test/test_psutil.py b/test/test_psutil.py
index 5b0b9b8d..3650e333 100644
--- a/test/test_psutil.py
+++ b/test/test_psutil.py
@@ -46,7 +46,7 @@ BSD = sys.platform.startswith("freebsd")
_subprocesses_started = set()
-def get_test_subprocess(cmd=None, stdout=DEVNULL, stderr=DEVNULL, stdin=None,
+def get_test_subprocess(cmd=None, stdout=DEVNULL, stderr=DEVNULL, stdin=DEVNULL,
wait=False):
"""Return a subprocess.Popen object to use in tests.
By default stdout and stderr are redirected to /dev/null and the
@@ -1064,8 +1064,9 @@ class TestCase(unittest.TestCase):
def test_name(self):
sproc = get_test_subprocess(PYTHON, wait=True)
+ name = psutil.Process(sproc.pid).name.lower()
pyexe = os.path.basename(os.path.realpath(sys.executable)).lower()
- self.assertEqual(psutil.Process(sproc.pid).name.lower(), pyexe)
+ assert pyexe.startswith(name), (pyexe, name)
if os.name == 'posix':