diff options
| author | amajorek <devnull@localhost> | 2010-03-07 04:26:46 -0500 |
|---|---|---|
| committer | amajorek <devnull@localhost> | 2010-03-07 04:26:46 -0500 |
| commit | fcd285741b4636238b1cbdbc054f8dd53960f739 (patch) | |
| tree | fbd303787d07a957c88bfbfd13116ecc8c330a67 /eventlet/debug.py | |
| parent | 01c37d5cb2c46a631c67036900e7028c35e6e389 (diff) | |
| download | eventlet-fcd285741b4636238b1cbdbc054f8dd53960f739.tar.gz | |
py3k - more changes
- _SilentException inherits from BaseException
- eveltnet.debug parsing changed to use re.split instead of string.maketrans and string.translate
Diffstat (limited to 'eventlet/debug.py')
| -rw-r--r-- | eventlet/debug.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/eventlet/debug.py b/eventlet/debug.py index 5e44eeb..fd15a49 100644 --- a/eventlet/debug.py +++ b/eventlet/debug.py @@ -4,12 +4,14 @@ debugging Eventlet-powered applications.""" import os import sys import linecache -import string +import re import inspect __all__ = ['spew', 'unspew', 'format_hub_listeners', 'hub_listener_stacks', 'hub_exceptions', 'tpool_exceptions'] +_token_spliter = re.compile('\W+') + class Spew(object): """ """ @@ -39,16 +41,15 @@ class Spew(object): print '%s:%s: %s' % (name, lineno, line.rstrip()) if not self.show_values: return self - details = '\t' - tokens = line.translate( - string.maketrans(' ,.()', '\0' * 5)).split('\0') + details = [] + tokens = _token_spliter.split(line) for tok in tokens: if tok in frame.f_globals: - details += '%s=%r ' % (tok, frame.f_globals[tok]) + details.append('%s=%r' % (tok, frame.f_globals[tok])) if tok in frame.f_locals: - details += '%s=%r ' % (tok, frame.f_locals[tok]) - if details.strip(): - print details + details.append('%s=%r' % (tok, frame.f_locals[tok])) + if details: + print "\t%s" % ' '.join(details) return self |
