Check for ImportError rather than any exception
This commit is contained in:
parent
c35316f158
commit
3d12aa8a28
2 changed files with 2 additions and 2 deletions
|
|
@ -5,7 +5,7 @@ import time
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
try:
|
try:
|
||||||
from urlparse import urlparse
|
from urlparse import urlparse
|
||||||
except:
|
except ImportError:
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
from .exceptions import ConnectionError, TimeoutError, PacketError
|
from .exceptions import ConnectionError, TimeoutError, PacketError
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import time
|
||||||
import websocket
|
import websocket
|
||||||
try:
|
try:
|
||||||
from itertools import izip
|
from itertools import izip
|
||||||
except:
|
except ImportError:
|
||||||
izip = zip
|
izip = zip
|
||||||
|
|
||||||
from .exceptions import SocketIOError, ConnectionError, TimeoutError
|
from .exceptions import SocketIOError, ConnectionError, TimeoutError
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue