summaryrefslogtreecommitdiff
path: root/numpy/testing/decorators.py
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-07-21 06:05:03 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-07-21 06:05:03 +0000
commiteb6df7ca32375fe98c7902f77b90d6a7d9869ea3 (patch)
tree8db971363521fbb5659c0da0963ae6aac3a1c5ea /numpy/testing/decorators.py
parent56d6091935400947391bbb096ea8ab08bff67d4f (diff)
downloadnumpy-eb6df7ca32375fe98c7902f77b90d6a7d9869ea3.tar.gz
Fix 2.5-isms for deprecated decorator.
Diffstat (limited to 'numpy/testing/decorators.py')
-rw-r--r--numpy/testing/decorators.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/numpy/testing/decorators.py b/numpy/testing/decorators.py
index e8b09d188..e337c35e2 100644
--- a/numpy/testing/decorators.py
+++ b/numpy/testing/decorators.py
@@ -187,7 +187,10 @@ class WarningMessage(object):
local_values = locals()
for attr in self._WARNING_DETAILS:
setattr(self, attr, local_values[attr])
- self._category_name = category.__name__ if category else None
+ if category:
+ self._category_name = category.__name__
+ else:
+ self._category_name = None
def __str__(self):
return ("{message : %r, category : %r, filename : %r, lineno : %s, "
@@ -197,7 +200,10 @@ class WarningMessage(object):
class WarningManager:
def __init__(self, record=False, module=None):
self._record = record
- self._module = sys.modules['warnings'] if module is None else module
+ if module is None:
+ self._module = sys.modules['warnings']
+ else:
+ self._module = module
self._entered = False
def __enter__(self):