diff options
author | Tal Einat <tal.einat@socialcodeinc.com> | 2017-07-27 13:03:22 +0300 |
---|---|---|
committer | Tal Einat <tal.einat@socialcodeinc.com> | 2017-07-27 13:03:22 +0300 |
commit | 3eede93ee3c6aad5c7c7f8d9514f0d2a4be7d226 (patch) | |
tree | b7b39d1be5dbd409645809e7edaea0e0e3248005 /python | |
parent | dab9a704e61154dac870cade13283881955cf366 (diff) | |
download | pycurl-3eede93ee3c6aad5c7c7f8d9514f0d2a4be7d226.tar.gz |
fix and standardize ignoring of SIGPIPE in examples
Diffstat (limited to 'python')
-rw-r--r-- | python/curl/__init__.py | 5 |
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: |