##// END OF EJS Templates
py3: add a new strurl() which will convert a bytes url to str
Pulkit Goyal -
r32859:a05f3675 default
parent child Browse files
Show More
@@ -173,6 +173,10 b' if ispy3:'
173 return s
173 return s
174 return s.decode(u'latin-1')
174 return s.decode(u'latin-1')
175
175
176 def strurl(url):
177 """Converts a bytes url back to str"""
178 return url.decode(u'ascii')
179
176 def raisewithtb(exc, tb):
180 def raisewithtb(exc, tb):
177 """Raise exception with the given traceback"""
181 """Raise exception with the given traceback"""
178 raise exc.with_traceback(tb)
182 raise exc.with_traceback(tb)
@@ -244,6 +248,7 b' else:'
244 iterbytestr = iter
248 iterbytestr = iter
245 sysbytes = identity
249 sysbytes = identity
246 sysstr = identity
250 sysstr = identity
251 strurl = identity
247
252
248 # this can't be parsed on Python 3
253 # this can't be parsed on Python 3
249 exec('def raisewithtb(exc, tb):\n'
254 exec('def raisewithtb(exc, tb):\n'
General Comments 0
You need to be logged in to leave comments. Login now