summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon/syncdutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'geo-replication/syncdaemon/syncdutils.py')
-rw-r--r--geo-replication/syncdaemon/syncdutils.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/geo-replication/syncdaemon/syncdutils.py b/geo-replication/syncdaemon/syncdutils.py
index a17789995d8..d13c1c82853 100644
--- a/geo-replication/syncdaemon/syncdutils.py
+++ b/geo-replication/syncdaemon/syncdutils.py
@@ -1018,3 +1018,15 @@ def get_up_nodes(hosts, port):
up_nodes.append(h)
return up_nodes
+
+
+def pipe():
+ # Pipe routine for python2 and python3 compatiability
+ try:
+ (r, w) = os.pipe()
+ os.set_inheritable(r, True)
+ os.set_inheritable(w, True)
+ except AttributeError:
+ (r, w) = os.pipe()
+
+ return (r, w)