Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:11.4:Update
python-cherrypy
py26-deprecations.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File py26-deprecations.diff of Package python-cherrypy
http://cherrypy.org/changeset/2104 Index: trunk/cherrypy/_cperror.py =================================================================== --- trunk/cherrypy/_cperror.py (revision 2091) +++ trunk/cherrypy/_cperror.py (revision 2104) @@ -188,5 +188,7 @@ if status < 400 or status > 599: raise ValueError("status must be between 400 and 599.") - self.message = message + # See http://www.python.org/dev/peps/pep-0352/ + # self.message = message + self._message = message CherryPyException.__init__(self, status, message) @@ -212,5 +214,5 @@ content = self.get_error_page(self.status, traceback=tb, - message=self.message) + message=self._message) response.body = content response.headers['Content-Length'] = len(content) Index: trunk/cherrypy/lib/cptools.py =================================================================== --- trunk/cherrypy/lib/cptools.py (revision 2016) +++ trunk/cherrypy/lib/cptools.py (revision 2104) @@ -2,5 +2,9 @@ import logging -import md5 +try: + # Python 2.5+ + from hashlib import md5 +except ImportError: + from md5 import new as md5 import re @@ -41,5 +45,5 @@ if status == 200: etag = response.collapse_body() - etag = '"%s"' % md5.new(etag).hexdigest() + etag = '"%s"' % md5(etag).hexdigest() response.headers['ETag'] = etag Index: trunk/cherrypy/lib/httpauth.py =================================================================== --- trunk/cherrypy/lib/httpauth.py (revision 2034) +++ trunk/cherrypy/lib/httpauth.py (revision 2104) @@ -60,5 +60,9 @@ ################################################################################ -import md5 +try: + # Python 2.5+ + from hashlib import md5 +except ImportError: + from md5 import new as md5 import time import base64 @@ -77,6 +81,6 @@ # DIGEST_AUTH_ENCODERS = { - MD5: lambda val: md5.new (val).hexdigest (), - MD5_SESS: lambda val: md5.new (val).hexdigest (), + MD5: lambda val: md5(val).hexdigest(), + MD5_SESS: lambda val: md5(val).hexdigest(), # SHA: lambda val: sha.new (val).hexdigest (), } Index: trunk/cherrypy/lib/sessions.py =================================================================== --- trunk/cherrypy/lib/sessions.py (revision 2099) +++ trunk/cherrypy/lib/sessions.py (revision 2104) @@ -14,5 +14,9 @@ import pickle import random -import sha +try: + # Python 2.5+ + from hashlib import sha1 as sha +except ImportError: + from sha import new as sha import time import threading @@ -109,5 +113,5 @@ def generate_id(self): """Return a new session id.""" - return sha.new('%s' % random.random()).hexdigest() + return sha('%s' % random.random()).hexdigest() else: def generate_id(self):
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor