diff options
| author | Cyril Roelandt <cyril.roelandt@enovance.com> | 2014-03-18 12:22:50 +0100 |
|---|---|---|
| committer | Cyril Roelandt <cyril.roelandt@enovance.com> | 2014-03-18 12:22:50 +0100 |
| commit | 4b3635c01d650058227767d2253e32e902cbbed1 (patch) | |
| tree | 7efc29e129f01630618ea4bcd6b731b33c89ae10 /paste | |
| parent | fbd07d8a7cf88daf5d821601578d2f7bc1c92928 (diff) | |
| download | paste-4b3635c01d650058227767d2253e32e902cbbed1.tar.gz | |
Python 3: don't use tuples in function prototype
Unpack explicitly in the body of the function
Diffstat (limited to 'paste')
| -rw-r--r-- | paste/auth/cookie.py | 2 | ||||
| -rw-r--r-- | paste/fixture.py | 3 | ||||
| -rw-r--r-- | paste/util/PySourceColor.py | 4 |
3 files changed, 6 insertions, 3 deletions
diff --git a/paste/auth/cookie.py b/paste/auth/cookie.py index 2601a90..a173f59 100644 --- a/paste/auth/cookie.py +++ b/paste/auth/cookie.py @@ -62,7 +62,7 @@ _encode = [('\\', '\\x5c'), ('"', '\\x22'), _decode = [(v, k) for (k, v) in _encode] _decode.reverse() def encode(s, sublist = _encode): - return reduce((lambda a, (b, c): a.replace(b, c)), sublist, str(s)) + return six.moves.reduce((lambda a, b: a.replace(b[0], b[1])), sublist, str(s)) decode = lambda s: encode(s, _decode) class CookieTooLarge(RuntimeError): diff --git a/paste/fixture.py b/paste/fixture.py index 0cf3a27..f3140ec 100644 --- a/paste/fixture.py +++ b/paste/fixture.py @@ -447,7 +447,8 @@ class TestApp(object): raise AppError( "Application had errors logged:\n%s" % res.errors) - def _make_response(self, (status, headers, body, errors), total_time): + def _make_response(self, resp, total_time): + status, headers, body, errors = resp return TestResponse(self, status, headers, body, errors, total_time) diff --git a/paste/util/PySourceColor.py b/paste/util/PySourceColor.py index 64c0f56..9de5b84 100644 --- a/paste/util/PySourceColor.py +++ b/paste/util/PySourceColor.py @@ -1324,9 +1324,11 @@ class Parser(object): else:
self._doSnippetEnd()
- def __call__(self, toktype, toktext, (srow,scol), (erow,ecol), line):
+ def __call__(self, toktype, toktext, srow_col, erow_col, line):
"""Token handler. Order is important do not rearrange."""
self.line = line
+ srow, scol = srow_col
+ erow, ecol = erow_col
# Calculate new positions
oldpos = self.pos
newpos = self.lines[srow] + scol
|
