mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
py3: add a new strurl() which will convert a bytes url to str
This commit is contained in:
parent
00240434ab
commit
6554e26b45
@ -173,6 +173,10 @@ if ispy3:
|
||||
return s
|
||||
return s.decode(u'latin-1')
|
||||
|
||||
def strurl(url):
|
||||
"""Converts a bytes url back to str"""
|
||||
return url.decode(u'ascii')
|
||||
|
||||
def raisewithtb(exc, tb):
|
||||
"""Raise exception with the given traceback"""
|
||||
raise exc.with_traceback(tb)
|
||||
@ -244,6 +248,7 @@ else:
|
||||
iterbytestr = iter
|
||||
sysbytes = identity
|
||||
sysstr = identity
|
||||
strurl = identity
|
||||
|
||||
# this can't be parsed on Python 3
|
||||
exec('def raisewithtb(exc, tb):\n'
|
||||
|
Loading…
Reference in New Issue
Block a user