summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNils Philippsen <nils@redhat.com>2015-09-09 11:09:59 +0200
committerNils Philippsen <nils@redhat.com>2015-09-09 11:09:59 +0200
commit75020c5f92846963892798514df48d8a2ad6b8a5 (patch)
treec8794fc89f9c09a6ff70fcca1f5388473a5addef
parente429aea5bc693ffb50b7cdaefd0a6e24ead2afa1 (diff)
downloadpaste-75020c5f92846963892798514df48d8a2ad6b8a5.tar.gz
Python 3: avoid spurious warnings
The dict.has_keys() method doesn't exist anymore in python 3, check if the locals() object has a .keys() method instead.
-rw-r--r--paste/exceptions/collector.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/paste/exceptions/collector.py b/paste/exceptions/collector.py
index 8867bf7..632ce06 100644
--- a/paste/exceptions/collector.py
+++ b/paste/exceptions/collector.py
@@ -266,7 +266,7 @@ class ExceptionCollector(object):
name = co.co_name
globals = f.f_globals
locals = f.f_locals
- if not hasattr(locals, 'has_key'):
+ if not hasattr(locals, 'keys'):
# Something weird about this frame; it's not a real dict
warnings.warn(
"Frame %s has an invalid locals(): %r" % (