diff options
| author | Kotresh HR <khiremat@redhat.com> | 2019-11-12 21:53:20 +0530 | 
|---|---|---|
| committer | hari gowtham <hari.gowtham005@gmail.com> | 2019-11-14 13:19:21 +0000 | 
| commit | 16331f6df4f45dfce6f7e03afc2057b5b543bc93 (patch) | |
| tree | e56cfc3011a7f2847c279e2560decb06e10f6d2f /geo-replication/syncdaemon/repce.py | |
| parent | 7f58624cbf88e235dc44714c5f5b00cffcab6b59 (diff) | |
geo-rep: Fix py2/py3 compatibility in repce
Geo-rep fails to start on python2 only machine like
centos6. It fails with "ImportError no module named _io".
This patch fixes the same.
Backport of:
 > Patch: https://review.gluster.org/23702/
 > BUG: 1771577
 > Change-Id: I8228458a853a230546f9faf29a0e9e0f23b3efec
 > Signed-off-by: Kotresh HR <khiremat@redhat.com>
(cherry picked from commit 9595ecca3de49fdf37d30b151f5c3e071e0a80d0)
Change-Id: I8228458a853a230546f9faf29a0e9e0f23b3efec
Signed-off-by: Kotresh HR <khiremat@redhat.com>
fixes: bz#1771840
Diffstat (limited to 'geo-replication/syncdaemon/repce.py')
| -rw-r--r-- | geo-replication/syncdaemon/repce.py | 5 | 
1 files changed, 2 insertions, 3 deletions
diff --git a/geo-replication/syncdaemon/repce.py b/geo-replication/syncdaemon/repce.py index 6065b828c99..c622afa6373 100644 --- a/geo-replication/syncdaemon/repce.py +++ b/geo-replication/syncdaemon/repce.py @@ -8,7 +8,6 @@  # cases as published by the Free Software Foundation.  # -import _io  import os  import sys  import time @@ -58,9 +57,9 @@ def recv(inf):      """load an object from input stream      python2 and python3 compatibility, inf is sys.stdin      and is opened as text stream by default. Hence using the -    buffer attribute +    buffer attribute in python3      """ -    if isinstance(inf, _io.TextIOWrapper): +    if hasattr(inf, "buffer"):          return pickle.load(inf.buffer)      else:          return pickle.load(inf)  | 
