Changeset 555
- Timestamp:
- 08/26/05 02:43:07
- Files:
-
- trunk/cherrypy/_cphttptools.py (modified) (2 diffs)
- trunk/cherrypy/_cputil.py (modified) (2 diffs)
- trunk/cherrypy/config.py (modified) (1 diff)
- trunk/cherrypy/lib/cptools.py (modified) (1 diff)
- trunk/cherrypy/lib/filter/cachefilter.py (modified) (1 diff)
- trunk/cherrypy/lib/filter/sessionfilter/anydbadaptor.py (modified) (2 diffs)
- trunk/cherrypy/lib/filter/sessionfilter/fileadaptor.py (modified) (2 diffs)
- trunk/cherrypy/lib/filter/sessionfilter/ramadaptor.py (modified) (2 diffs)
- trunk/cherrypy/test/helper.py (modified) (1 diff)
- trunk/cherrypy/test/test_core.py (modified) (3 diffs)
- trunk/cherrypy/test/test_gzip_filter.py (modified) (1 diff)
- trunk/cherrypy/test/webtest.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cphttptools.py
r549 r555 369 369 cherrypy.response.body = ["HTTP/1.1 requires a 'Host' request header."] 370 370 finalize() 371 raise cherrypy.RequestHandled 371 raise cherrypy.RequestHandled() 372 372 req.base = "%s://%s" % (req.scheme, req.headerMap.get('Host', '')) 373 373 req.browserUrl = req.base + req.path … … 890 890 serve_file(icofile) 891 891 finalize() 892 raise cherrypy.RequestHandled 892 raise cherrypy.RequestHandled() 893 893 else: 894 894 # We didn't find anything trunk/cherrypy/_cputil.py
r531 r555 360 360 return Builder().build(getObj(s)) 361 361 except: 362 raise #cherrypy.WrongUnreprValue , repr(s)362 raise #cherrypy.WrongUnreprValue(repr(s)) 363 363 364 364 def modules(modulePath): … … 367 367 mod = sys.modules[modulePath] 368 368 if mod is None: 369 raise KeyError 369 raise KeyError() 370 370 except KeyError: 371 371 # The last [''] is important. trunk/cherrypy/config.py
r526 r555 187 187 msg = ("section: %s, option: %s, value: %s" % 188 188 (repr(section), repr(option), repr(value))) 189 raise _cperror.WrongConfigValue , msg189 raise _cperror.WrongConfigValue(msg) 190 190 result[section][option] = value 191 191 return result trunk/cherrypy/lib/cptools.py
r521 r555 113 113 except TypeError: 114 114 pass 115 raise cherrypy.NotFound , cherrypy.request.path115 raise cherrypy.NotFound(cherrypy.request.path) 116 116 default.exposed = True trunk/cherrypy/lib/filter/cachefilter.py
r521 r555 152 152 cherrypy.response.status, cherrypy.response.headers, body = obj 153 153 cherrypy.response.body = body 154 raise cherrypy.RequestHandled 154 raise cherrypy.RequestHandled() 155 155 156 156 def onEndResource(self): trunk/cherrypy/lib/filter/sessionfilter/anydbadaptor.py
r532 r555 65 65 return self.__data[sessionKey] 66 66 except KeyError: 67 raise SessionNotFoundError 67 raise SessionNotFoundError() 68 68 69 69 def saveSessionDict(self, sessionData): … … 74 74 del self.__data[sessionKey] 75 75 except KeyError: 76 raise SessionNotFoundError 76 raise SessionNotFoundError() 77 77 78 78 def _cleanUpOldSessions(self): trunk/cherrypy/lib/filter/sessionfilter/fileadaptor.py
r541 r555 54 54 def getSessionDict(self, sessionKey): 55 55 if not sessionKey: 56 raise SessionNotFoundError 56 raise SessionNotFoundError() 57 57 58 58 storagePath = self.getSetting('storagePath') … … 71 71 return sessionData 72 72 else: 73 raise SessionNotFoundError 73 raise SessionNotFoundError() 74 74 75 75 def saveSessionDict(self, sessionData): trunk/cherrypy/lib/filter/sessionfilter/ramadaptor.py
r532 r555 48 48 return self.__data[sessionKey] 49 49 except KeyError: 50 raise SessionNotFoundError 50 raise SessionNotFoundError() 51 51 52 52 def saveSessionDict(self, sessionData): … … 61 61 del self.__data[sessionKey] 62 62 except KeyError: 63 raise SessionNotFoundError 63 raise SessionNotFoundError() 64 64 65 65 def _cleanUpOldSessions(self): trunk/cherrypy/test/helper.py
r546 r555 111 111 if webtest.ServerError.on: 112 112 self.tearDown() 113 raise webtest.ServerError 113 raise webtest.ServerError() 114 114 115 115 def tearDown(self): trunk/cherrypy/test/test_core.py
r549 r555 154 154 155 155 def page_method(self): 156 raise ValueError 156 raise ValueError() 157 157 158 158 def page_yield(self): 159 159 yield "hello" 160 raise ValueError 160 raise ValueError() 161 161 162 162 def page_http_1_1(self): … … 164 164 def inner(): 165 165 yield "hello" 166 raise ValueError 166 raise ValueError() 167 167 yield "very oops" 168 168 return inner() … … 433 433 ignore.append(ValueError) 434 434 try: 435 valerr = r'\n raise ValueError\ nValueError\n$'435 valerr = r'\n raise ValueError\(\)\nValueError\n$' 436 436 self.getPage("/error/page_method") 437 437 self.assertMatchesBody(valerr) trunk/cherrypy/test/test_gzip_filter.py
r534 r555 38 38 # Test for ticket #147, where yield showed no exceptions (content- 39 39 # encoding was still gzip even though traceback wasn't zipped). 40 raise IndexError 40 raise IndexError() 41 41 yield "Here be dragons" 42 42 noshow.exposed = True trunk/cherrypy/test/webtest.py
r537 r555 107 107 if module is None: 108 108 if not parts: 109 raise ValueError , "incomplete test name: %s" % name109 raise ValueError("incomplete test name: %s" % name) 110 110 else: 111 111 parts_copy = parts[:] … … 121 121 except ImportError: 122 122 del parts_copy[-1] 123 if not parts_copy: raise 123 if not parts_copy: 124 raise 124 125 parts = parts[1:] 125 126 obj = module … … 138 139 if not isinstance(test, TestCase) and \ 139 140 not isinstance(test, TestSuite): 140 raise ValueError , \141 "calling %s returned %s, not a test" % (obj,test)141 raise ValueError("calling %s returned %s, " 142 "not a test" % (obj,test)) 142 143 return test 143 144 else: 144 raise ValueError , "don't know how to make test from: %s" % obj145 raise ValueError("don't know how to make test from: %s" % obj) 145 146 146 147 … … 182 183 183 184 if ServerError.on: 184 raise ServerError 185 raise ServerError() 185 186 return result 186 187 … … 190 191 def _handlewebError(self, msg): 191 192 if not self.interactive: 192 raise self.failureException , msg193 raise self.failureException(msg) 193 194 194 195 print … … 222 223 return 223 224 elif i == "R": 224 raise self.failureException , msg225 raise self.failureException(msg) 225 226 elif i == "X": 226 227 sys.exit()

