##// END OF EJS Templates
pycompat: prevent encoding or decoding values if not required...
Pulkit Goyal -
r36662:e2b87e19 default
parent child Browse files
Show More
@@ -192,11 +192,15 b' if ispy3:'
192
192
193 def strurl(url):
193 def strurl(url):
194 """Converts a bytes url back to str"""
194 """Converts a bytes url back to str"""
195 return url.decode(u'ascii')
195 if isinstance(url, bytes):
196 return url.decode(u'ascii')
197 return url
196
198
197 def bytesurl(url):
199 def bytesurl(url):
198 """Converts a str url to bytes by encoding in ascii"""
200 """Converts a str url to bytes by encoding in ascii"""
199 return url.encode(u'ascii')
201 if isinstance(url, str):
202 return url.encode(u'ascii')
203 return url
200
204
201 def raisewithtb(exc, tb):
205 def raisewithtb(exc, tb):
202 """Raise exception with the given traceback"""
206 """Raise exception with the given traceback"""
General Comments 0
You need to be logged in to leave comments. Login now