##// END OF EJS Templates
py3: add a new bytesurl() to convert a str url into bytes
Pulkit Goyal -
r32860:f22f39d5 default
parent child Browse files
Show More
@@ -177,6 +177,10 b' if ispy3:'
177 177 """Converts a bytes url back to str"""
178 178 return url.decode(u'ascii')
179 179
180 def bytesurl(url):
181 """Converts a str url to bytes by encoding in ascii"""
182 return url.encode(u'ascii')
183
180 184 def raisewithtb(exc, tb):
181 185 """Raise exception with the given traceback"""
182 186 raise exc.with_traceback(tb)
@@ -249,6 +253,7 b' else:'
249 253 sysbytes = identity
250 254 sysstr = identity
251 255 strurl = identity
256 bytesurl = identity
252 257
253 258 # this can't be parsed on Python 3
254 259 exec('def raisewithtb(exc, tb):\n'
General Comments 0
You need to be logged in to leave comments. Login now