Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
Changes from all commits
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
6 changes: 3 additions & 3 deletions apns.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from datetime import datetime, timedelta
from time import mktime
from random import getrandbits
from socket import socket, AF_INET, SOCK_STREAM, timeout
from socket import socket, AF_INET, SOCK_STREAM, timeout, error
from struct import pack, unpack

import os
Expand Down Expand Up @@ -338,7 +338,7 @@ def send_notification(self, token_hex, payload, expiry=None):

try: # Connection might have been closed
self.write(self._get_notification(token_hex, payload, identifier, expiry))
except SSLError:
except (SSLError, error):
# We were disconnected or timeout.
# Prepare to reconnect.
self._disconnect()
Expand All @@ -365,4 +365,4 @@ def send_notification(self, token_hex, payload, expiry=None):
pass # Timeouts are OK - don't reconnect
except APNResponseError:
self._disconnect() # Make sure we're ready for next send.
raise
raise