Mercurial > hg-stable
changeset 37661:afe624d78d43
py3: use urllib.parse.unquote_plus instead of urllib.unquote_plus
The later is not present in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D3322
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 14 Apr 2018 00:56:44 +0530 |
parents | 9dfa4e9ed45d |
children | 5340daa85c62 |
files | tests/test-narrow-clone-non-narrow-server.t |
diffstat | 1 files changed, 13 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-narrow-clone-non-narrow-server.t Fri Apr 13 18:41:56 2018 +0530 +++ b/tests/test-narrow-clone-non-narrow-server.t Sat Apr 14 00:56:44 2018 +0530 @@ -18,8 +18,20 @@ $ cat hg.pid >> "$DAEMON_PIDS" Verify that narrow is advertised in the bundle2 capabilities: + + $ cat >> unquote.py <<EOF + > from __future__ import print_function + > import sys + > if sys.version[0] == '3': + > import urllib.parse as up + > unquote = up.unquote_plus + > else: + > import urllib + > unquote = urllib.unquote_plus + > print(unquote(list(sys.stdin)[1])) + > EOF $ echo hello | hg -R . serve --stdio | \ - > $PYTHON -c "from __future__ import print_function; import sys, urllib; print(urllib.unquote_plus(list(sys.stdin)[1]))" | grep narrow + > $PYTHON unquote.py | grep narrow narrow=v0 $ cd ..