From: "Jianhong.Yin" <yin-jianhong@xxxxxxx> Signed-off-by: Jianhong Yin <yin-jianhong@xxxxxxx> --- nfs4.0/lib/rpc/rpc.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/nfs4.0/lib/rpc/rpc.py b/nfs4.0/lib/rpc/rpc.py index 86075b2..93f20dc 100644 --- a/nfs4.0/lib/rpc/rpc.py +++ b/nfs4.0/lib/rpc/rpc.py @@ -176,9 +176,14 @@ def _send_record(self, data, chunksize=2048): mark = struct.pack('>L', last | len(chunk)) self.sendall(mark + chunk) -socket._socketobject.recv_all = _recv_all -socket._socketobject.recv_record = _recv_record -socket._socketobject.send_record = _send_record +try: #for python2 + socket._socketobject.recv_all = _recv_all + socket._socketobject.recv_record = _recv_record + socket._socketobject.send_record = _send_record +except: #for python3 + socket.recv_all = _recv_all + socket.recv_record = _recv_record + socket.send_record = _send_record ################################################# -- 2.17.1 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html