[Python-modules-commits] [txfixtures] 04/14: Drop python3-compat.patch (merged upstream)
Free Ekanayaka
freee at moszumanska.debian.org
Thu Jan 5 23:51:20 UTC 2017
This is an automated email from the git hooks/post-receive script.
freee pushed a commit to branch master
in repository txfixtures.
commit 634b36a9fd4c11a0f4866f7b5cb9ba7b5e8d17e0
Author: Free Ekanayaka <freee at debian.org>
Date: Tue Dec 20 14:44:59 2016 +0000
Drop python3-compat.patch (merged upstream)
---
debian/patches/0001-python3-compat.patch | 108 -------------------------------
debian/patches/series | 1 -
2 files changed, 109 deletions(-)
diff --git a/debian/patches/0001-python3-compat.patch b/debian/patches/0001-python3-compat.patch
deleted file mode 100644
index 3275883..0000000
--- a/debian/patches/0001-python3-compat.patch
+++ /dev/null
@@ -1,108 +0,0 @@
-From: Free Ekanayaka <freee at debian.org>
-Date: Tue, 22 Nov 2016 10:13:38 +0000
-Subject: python3-compat
-
-Adapt syntax to be compatible with Python 3.
----
- txfixtures/osutils.py | 13 +++++++------
- txfixtures/tachandler.py | 10 ++++++----
- 2 files changed, 13 insertions(+), 10 deletions(-)
-
-diff --git a/txfixtures/osutils.py b/txfixtures/osutils.py
-index c5e22ed..2c68c96 100644
---- a/txfixtures/osutils.py
-+++ b/txfixtures/osutils.py
-@@ -21,7 +21,7 @@ def _kill_may_race(pid, signal_number):
- """Kill a pid accepting that it may not exist."""
- try:
- os.kill(pid, signal_number)
-- except OSError, e:
-+ except OSError as e:
- if e.errno in (errno.ESRCH, errno.ECHILD):
- # Process has already been killed.
- return
-@@ -34,7 +34,8 @@ def get_pid_from_file(pidfile_path):
- if not os.path.exists(pidfile_path):
- return None
- # Get the pid.
-- pid = open(pidfile_path, 'r').read().split()[0]
-+ with open(pidfile_path, 'r') as fd:
-+ pid = fd.read().split()[0]
- try:
- pid = int(pid)
- except ValueError:
-@@ -63,7 +64,7 @@ def two_stage_kill(pid, poll_interval=0.1, num_polls=50):
- if new_pid:
- return result
- time.sleep(poll_interval)
-- except OSError, e:
-+ except OSError as e:
- if e.errno in (errno.ESRCH, errno.ECHILD):
- # Raised if the process is gone by the time we try to get the
- # return value.
-@@ -92,7 +93,7 @@ def remove_if_exists(path):
- """Remove the given file if it exists."""
- try:
- os.remove(path)
-- except OSError, e:
-+ except OSError as e:
- if e.errno != errno.ENOENT:
- raise
-
-@@ -111,11 +112,11 @@ def until_no_eintr(retries, function, *args, **kwargs):
- for i in range(retries):
- try:
- return function(*args, **kwargs)
-- except (IOError, OSError), e:
-+ except (IOError, OSError) as e:
- if e.errno == errno.EINTR:
- continue
- raise
-- except socket.error, e:
-+ except socket.error as e:
- # In Python 2.6 we can use IOError instead. It also has
- # reason.errno but we might be using 2.5 here so use the
- # index hack.
-diff --git a/txfixtures/tachandler.py b/txfixtures/tachandler.py
-index 70f8b0f..cf6f591 100644
---- a/txfixtures/tachandler.py
-+++ b/txfixtures/tachandler.py
-@@ -96,17 +96,17 @@ class TacTestFixture(Fixture):
-
- # Run twistd, and raise an error if the return value is non-zero or
- # stdout/stderr are written to.
-- proc = subprocess.Popen(
-+ self._proc = subprocess.Popen(
- args,
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT,
- )
- self.addCleanup(self.killTac)
-- stdout = until_no_eintr(10, proc.stdout.read)
-+ stdout = until_no_eintr(10, self._proc.stdout.read)
- if stdout:
- raise TacException('Error running %s: unclean stdout/err: %s'
- % (args, stdout))
-- rv = proc.wait()
-+ rv = self._proc.wait()
- # twistd will normally fork off into the background with the
- # originally-spawned process exiting 0.
- if rv != 0:
-@@ -132,7 +132,7 @@ class TacTestFixture(Fixture):
- s.connect((host, port))
- s.close()
- return True
-- except socket.error, e:
-+ except socket.error as e:
- if e.errno == errno.ECONNREFUSED:
- return False
- else:
-@@ -166,6 +166,8 @@ class TacTestFixture(Fixture):
- """Kill the TAC file if it is running."""
- pidfile = self.pidfile
- kill_by_pidfile(pidfile)
-+ # Close the pipe
-+ self._proc.stdout.close()
-
- def sendSignal(self, sig):
- """Send the given signal to the tac process."""
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index 6768dfe..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1 +0,0 @@
-0001-python3-compat.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/txfixtures.git
More information about the Python-modules-commits
mailing list