From 525fcfc0fb8099eae1ad92b44e14f5ca9b27780e Mon Sep 17 00:00:00 2001 From: Allan Lewis Date: Wed, 27 Apr 2016 15:00:56 +0100 Subject: wsdump, test_fuzzingclient, websocket.*, test_websocket: Organise imports Previously, because of the multiple instances of `from foo import *`, names were imported from modules that had themselves imported them, instead of from the place of definition. This commit therefore does the following: - Declares `__all__` in every module that imports anything, so that `from foo import *` is sane. - Sorts the imports based on conventions, similar to the output of `isort`. - Places all conditional imports after unconditional imports, except where that isn't valid. - Imports local names from the modules where they are defined, except when importing the package itself. --- websocket/_socket.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'websocket/_socket.py') diff --git a/websocket/_socket.py b/websocket/_socket.py index f2bc4f1..e2e1dd2 100644 --- a/websocket/_socket.py +++ b/websocket/_socket.py @@ -19,13 +19,13 @@ Copyright (C) 2010 Hiroki Ohtani(liris) Boston, MA 02110-1335 USA """ - import socket + import six from ._exceptions import * -from ._utils import * from ._ssl_compat import * +from ._utils import * DEFAULT_SOCKET_OPTION = [(socket.SOL_TCP, socket.TCP_NODELAY, 1)] if hasattr(socket, "SO_KEEPALIVE"): -- cgit v1.2.1