summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorTal Einat <tal.einat@socialcodeinc.com>2017-07-27 13:03:22 +0300
committerTal Einat <tal.einat@socialcodeinc.com>2017-07-27 13:03:22 +0300
commit3eede93ee3c6aad5c7c7f8d9514f0d2a4be7d226 (patch)
treeb7b39d1be5dbd409645809e7edaea0e0e3248005 /python
parentdab9a704e61154dac870cade13283881955cf366 (diff)
downloadpycurl-3eede93ee3c6aad5c7c7f8d9514f0d2a4be7d226.tar.gz
fix and standardize ignoring of SIGPIPE in examples
Diffstat (limited to 'python')
-rw-r--r--python/curl/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/curl/__init__.py b/python/curl/__init__.py
index f92687d..9fb9171 100644
--- a/python/curl/__init__.py
+++ b/python/curl/__init__.py
@@ -21,12 +21,15 @@ else:
except ImportError:
from StringIO import StringIO as BytesIO
+# We should ignore SIGPIPE when using pycurl.NOSIGNAL - see
+# the libcurl tutorial for more info.
try:
import signal
from signal import SIGPIPE, SIG_IGN
- signal.signal(SIGPIPE, SIG_IGN)
except ImportError:
pass
+else:
+ signal.signal(SIGPIPE, SIG_IGN)
class Curl: