Patchwork [10,of,10] py3: replace use of Request.get_data() with pycompat.request_get_data(request)

login
register
mail settings
Submitter Pulkit Goyal
Date May 6, 2017, 3:01 a.m.
Message ID <d4a667d6553c2b654644.1494039682@pulkit-goyal>
Download mbox | patch
Permalink /patch/20478/
State Accepted
Headers show

Comments

Pulkit Goyal - May 6, 2017, 3:01 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1494037845 -19800
#      Sat May 06 08:00:45 2017 +0530
# Node ID d4a667d6553c2b654644c38d8e2bacc7610287ca
# Parent  ab836b82e94bac18f61bde86c57ff5a57d76ece6
py3: replace use of Request.get_data() with pycompat.request_get_data(request)

Request.get_data() is not present in Py3.5.

Patch

diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py
--- a/mercurial/keepalive.py
+++ b/mercurial/keepalive.py
@@ -311,7 +311,7 @@ 
                 skipheaders['skip_' + n.replace('-', '_')] = 1
         try:
             if pycompat.request_has_data(req):
-                data = req.get_data()
+                data = pycompat.request_get_data(req)
                 h.putrequest(
                     req.get_method(), req.get_selector(), **skipheaders)
                 if 'content-type' not in headers: