Submitter | Pulkit Goyal |
---|---|
Date | May 6, 2017, 3:01 a.m. |
Message ID | <980cc6b0ab20c38bd0d8.1494039680@pulkit-goyal> |
Download | mbox | patch |
Permalink | /patch/20476/ |
State | Accepted |
Headers | show |
Comments
Patch
diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py --- a/mercurial/pycompat.py +++ b/mercurial/pycompat.py @@ -434,3 +434,15 @@ urlreq.quote = quote urlreq.urlencode = urlencode + +def request_has_data(request): + '''implementation of urllib2.request.has_data() from Python 2.7''' + return request.data is not None + +def request_get_data(request): + '''implementation of urllib2.request.get_data() from Python 2.7''' + return request.data + +def request_add_data(request, data): + '''implementation of urllib2.request.add_data() from Python 2.7''' + request.data = data