diff options
| author | Robert Brewer <fumanchu@aminus.org> | 2011-10-18 21:55:53 -0700 |
|---|---|---|
| committer | Robert Brewer <fumanchu@aminus.org> | 2011-10-18 21:55:53 -0700 |
| commit | b1ef8e7e6e16cbb1af06a0b2c7b52be093e7362d (patch) | |
| tree | 9aa21cbaa2d7f0123ef0d303f9d2987aade00dc3 /cherrypy | |
| parent | 338694cafe83db5ef5b8944de43d3235fcb739ba (diff) | |
| download | cherrypy-git-cherrypy-3.2.2.tar.gz | |
A couple of Python 2.3 fixescherrypy-3.2.2
Diffstat (limited to 'cherrypy')
| -rw-r--r-- | cherrypy/test/helper.py | 5 | ||||
| -rw-r--r-- | cherrypy/test/test_core.py | 8 |
2 files changed, 7 insertions, 6 deletions
diff --git a/cherrypy/test/helper.py b/cherrypy/test/helper.py index fa3b89f8..e3006a52 100644 --- a/cherrypy/test/helper.py +++ b/cherrypy/test/helper.py @@ -300,8 +300,9 @@ class CPWebCase(webtest.WebCase): if self.do_gc_test: self.getPage("/gc/stats") self.assertBody("Statistics:") - # Tell nose to run this last in each class - test_gc.compat_co_firstlineno = float('inf') + # Tell nose to run this last in each class. + # Prefer sys.maxint for Python 2.3, which didn't have float('inf') + test_gc.compat_co_firstlineno = getattr(sys, 'maxint', None) or float('inf') def prefix(self): return self.script_name.rstrip("/") diff --git a/cherrypy/test/test_core.py b/cherrypy/test/test_core.py index 3c39f5cd..0956a94a 100644 --- a/cherrypy/test/test_core.py +++ b/cherrypy/test/test_core.py @@ -262,12 +262,12 @@ class CoreRequestHandlingTest(helper.CPWebCase): class MultiHeader(Test): - @cherrypy.tools.append_headers(header_list=[ - (ntob('WWW-Authenticate'), ntob('Negotiate')), - (ntob('WWW-Authenticate'), ntob('Basic realm="foo"')), - ]) def header_list(self): pass + header_list = cherrypy.tools.append_headers(header_list=[ + (ntob('WWW-Authenticate'), ntob('Negotiate')), + (ntob('WWW-Authenticate'), ntob('Basic realm="foo"')), + ])(header_list) def commas(self): cherrypy.response.headers['WWW-Authenticate'] = 'Negotiate,Basic realm="foo"' |
