summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAllan Lewis <allanlewis@users.noreply.github.com>2016-04-27 15:00:56 +0100
committerAllan Lewis <allanlewis@users.noreply.github.com>2016-04-27 15:00:56 +0100
commit525fcfc0fb8099eae1ad92b44e14f5ca9b27780e (patch)
treeff8b8044c2d5d445f48b41c3f1708c1b63dff5b9 /bin
parent9f138c94e71458172cd90dec49ce1d1163895c4f (diff)
downloadwebsocket-client-525fcfc0fb8099eae1ad92b44e14f5ca9b27780e.tar.gz
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.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/wsdump.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/wsdump.py b/bin/wsdump.py
index 0478070..5af00ac 100755
--- a/bin/wsdump.py
+++ b/bin/wsdump.py
@@ -2,12 +2,15 @@
import argparse
import code
-import six
import sys
import threading
import time
-import websocket
+
+import six
from six.moves.urllib.parse import urlparse
+
+import websocket
+
try:
import readline
except ImportError: