Skip to content

Commit

Permalink
Simplify HTTPResponse.exception
Browse files Browse the repository at this point in the history
- simplify comparison
- remove redundant parenthesis

modified:   src/ZPublisher/HTTPResponse.py
  • Loading branch information
jugmac00 committed May 1, 2019
1 parent a7c915e commit f212b9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ZPublisher/HTTPResponse.py
Expand Up @@ -855,7 +855,7 @@ def exception(self, fatal=0, info=None, abort=1):
self._unauthorized()

self.setStatus(t)
if self.status >= 300 and self.status < 400:
if 300 <= self.status < 400:
if isinstance(v, str) and absuri_match(v) is not None:
if self.status == 300:
self.setStatus(302)
Expand All @@ -872,7 +872,7 @@ def exception(self, fatal=0, info=None, abort=1):
else:
try:
l, b = v
if (isinstance(l, str) and absuri_match(l) is not None):
if isinstance(l, str) and absuri_match(l) is not None:
if self.status == 300:
self.setStatus(302)
self.setHeader('location', l)
Expand Down

0 comments on commit f212b9f

Please sign in to comment.