Mercurial > public > mercurial-scm > hg-stable
diff mercurial/templatefilters.py @ 28883:032c4c2f802a
pycompat: switch to util.urlreq/util.urlerr for py3 compat
author | timeless <timeless@mozdev.org> |
---|---|
date | Wed, 06 Apr 2016 23:22:12 +0000 |
parents | 11f623b5668f |
children | 53865692a354 |
line wrap: on
line diff
--- a/mercurial/templatefilters.py Thu Apr 07 00:05:48 2016 +0000 +++ b/mercurial/templatefilters.py Wed Apr 06 23:22:12 2016 +0000 @@ -11,7 +11,6 @@ import os import re import time -import urllib from . import ( encoding, @@ -22,6 +21,9 @@ util, ) +urlerr = util.urlerr +urlreq = util.urlreq + # filters are callables like: # fn(obj) # with: @@ -299,7 +301,7 @@ Forward slashes are escaped twice to prevent web servers from prematurely unescaping them. For example, "@foo bar/baz" becomes "@foo%20bar%252Fbaz". """ - return urllib.quote(text, safe='/@').replace('/', '%252F') + return urlreq.quote(text, safe='/@').replace('/', '%252F') @templatefilter('rfc3339date') def rfc3339date(text): @@ -384,7 +386,7 @@ """Any text. Escapes all "special" characters. For example, "foo bar" becomes "foo%20bar". """ - return urllib.quote(text) + return urlreq.quote(text) @templatefilter('user') def userfilter(text):