Show More
@@ -192,11 +192,15 b' if ispy3:' | |||
|
192 | 192 | |
|
193 | 193 | def strurl(url): |
|
194 | 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 | 199 | def bytesurl(url): |
|
198 | 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 | 205 | def raisewithtb(exc, tb): |
|
202 | 206 | """Raise exception with the given traceback""" |
General Comments 0
You need to be logged in to leave comments.
Login now