Skip to content

Commit 5fcfa95

Browse files
committed
adding compat
1 parent 9071e69 commit 5fcfa95

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ mysql-replication
22
requests
33
pyyaml
44
lxml
5-
5+
future #for py2 compat

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
'requests>=2.9.1',
1616
'PyYAML>=3.11',
1717
'lxml>=3.5.0',
18+
'future>=0.15.2'
1819
],
1920
entry_points={
2021
'console_scripts': [

src/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import os.path
1+
from __future__ import print_function, unicode_literals
2+
from future.builtins import str
3+
try:
4+
from subprocess import DEVNULL # PY3
5+
except ImportError:
6+
import os
7+
DEVNULL = open(os.devnull, 'wb')
28
import sys
39
import yaml
410
import signal
@@ -308,14 +314,14 @@ def _xml_dump_loader(self):
308314
mysqldump = subprocess.Popen(
309315
shlex.split(self.dump_cmd),
310316
stdout=subprocess.PIPE,
311-
stderr=subprocess.DEVNULL,
317+
stderr=DEVNULL,
312318
close_fds=True)
313319

314320
remove_invalid_pipe = subprocess.Popen(
315321
shlex.split(REMOVE_INVALID_PIPE),
316322
stdin=mysqldump.stdout,
317323
stdout=subprocess.PIPE,
318-
stderr=subprocess.DEVNULL,
324+
stderr=DEVNULL,
319325
close_fds=True)
320326

321327
return remove_invalid_pipe.stdout

0 commit comments

Comments
 (0)