Skip to content
This repository was archived by the owner on Mar 25, 2024. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/dogapi/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""

import socket
import ssl

__all__ = [
'DatadogException',
Expand All @@ -22,5 +21,10 @@ class ClientError(DatadogException): pass
class HttpTimeout(DatadogException): pass
class HttpBackoff(DatadogException): pass
class ApiError(DatadogException): pass
timeout_exceptions = (socket.timeout, ssl.SSLError)
timeout_exceptions = (socket.timeout, )

try:
import ssl
timeout_exceptions += timeout_exceptions + (ssl.SSLError, )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second timeout_exceptions is redundant I think.

except ImportError:
pass