summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
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: