Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Commits on Aug 20, 2014
Access WebOb exceptions directly (instead of calling exception property)
pylons depends on WebOb 1.1.1+ at this point, so this should be ok
Commits on Jan 03, 2015
Merge pull request #22 from dareonion/master
Access WebOb exceptions directly (WebOb 1.4 compatibility)
Showing with 5 additions and 5 deletions.
  1. +3 −3 pylons/controllers/util.py
  2. +2 −2 tests/test_units/test_controller.py
@@ -174,7 +174,7 @@ def index(self):
response.headers.pop('Content-Type', None)
response.headers.pop('Cache-Control', None)
response.headers.pop('Pragma', None)
raise status_map[304]().exception
raise status_map[304]()
else:
log.debug("ETag didn't match, returning response object")
@@ -207,7 +207,7 @@ def abort(status_code=None, detail="", headers=None, comment=None):
comment=comment)
log.debug("Aborting request, status: %s, detail: %r, headers: %r, "
"comment: %r", status_code, detail, headers, comment)
raise exc.exception
raise exc
def redirect(url, code=302):
@@ -221,4 +221,4 @@ def redirect(url, code=302):
"""
log.debug("Generating %s redirect" % code)
exc = status_map[code]
raise exc(location=url).exception
raise exc(location=url)
@@ -36,11 +36,11 @@ def strme(self):
def use_redirect(self):
pylons.response.set_cookie('message', 'Hello World')
exc = status_map[301]
raise exc('/elsewhere').exception
raise exc('/elsewhere')
def use_customnotfound(self):
exc = status_map[404]
raise exc('Custom not found').exception
raise exc('Custom not found')
def header_check(self):
pylons.response.headers['Content-Type'] = 'text/plain'

No commit comments for this range