Skip to content

Commit

Permalink
Make socket.timeout explicit, not just OSError
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphje committed Apr 8, 2016
1 parent 01aa8b6 commit 5c25d5b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internationalflavor/vat_number/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import unicode_literals

import re
import socket

from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
Expand Down Expand Up @@ -145,7 +146,7 @@ def _check_vies_suds(self, country, rest):
c = suds.client.Client(VIES_CHECK_WSDL, timeout=3)
res = c.service.checkVat(country, rest)
valid = res.valid is not False
except (suds.WebFault, suds.transport.TransportError, OSError) as e:
except (suds.WebFault, suds.transport.TransportError, socket.timeout) as e:
self._wsdl_exception = e
else:
if not valid:
Expand Down

0 comments on commit 5c25d5b

Please sign in to comment.