| To: | pcp developers <pcp@xxxxxxxxxxx> |
|---|---|
| Subject: | pmrep: Handle Python 3 BrokenPipeError in Python 2 Compatible Manner |
| From: | Marko Myllynen <myllynen@xxxxxxxxxx> |
| Date: | Mon, 21 Mar 2016 15:33:10 +0200 |
| Delivered-to: | pcp@xxxxxxxxxxx |
| Organization: | Red Hat |
| Reply-to: | Marko Myllynen <myllynen@xxxxxxxxxx> |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 |
Hi,
The subject says it all (if not handled here, Python 3 will complain
about ignoring BrokenPipeError). Should fix ticket #82.
---
src/pmrep/pmrep.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/pmrep/pmrep.py b/src/pmrep/pmrep.py
index 2bb37f5..5dd0827 100755
--- a/src/pmrep/pmrep.py
+++ b/src/pmrep/pmrep.py
@@ -1348,7 +1348,9 @@ class PMReporter(object):
if self.writer:
try:
self.writer.flush()
- except BrokenPipeError:
+ except socket.error as error:
+ if error.errno != errno.EPIPE:
+ raise
pass
self.writer.close()
self.writer = None
Thanks,
--
Marko Myllynen
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | pcp updates: small python fix, kenj+martins+zack merges, Nathan Scott |
|---|---|
| Next by Date: | Possible bug in pmwebapi, Benjamin De Cock |
| Previous by Thread: | pcp updates: small python fix, kenj+martins+zack merges, Nathan Scott |
| Next by Thread: | Possible bug in pmwebapi, Benjamin De Cock |
| Indexes: | [Date] [Thread] [Top] [All Lists] |