diff options
-rw-r--r-- | examples/linksys.py | 7 | ||||
-rw-r--r-- | examples/retriever-multi.py | 1 | ||||
-rw-r--r-- | examples/retriever.py | 1 | ||||
-rw-r--r-- | examples/sfquery.py | 2 | ||||
-rw-r--r-- | examples/tests/test_gtk.py | 1 | ||||
-rw-r--r-- | examples/xmlrpc_curl.py | 1 | ||||
-rw-r--r-- | python/curl/__init__.py | 1 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | tests/app.py | 6 | ||||
-rw-r--r-- | tests/curl_object_test.py | 4 | ||||
-rw-r--r-- | tests/internals_test.py | 2 | ||||
-rw-r--r-- | tests/matrix/check-python.py | 2 | ||||
-rw-r--r-- | tests/multi_socket_select_test.py | 2 | ||||
-rw-r--r-- | tests/multi_test.py | 4 | ||||
-rw-r--r-- | tests/option_constants_test.py | 2 | ||||
-rw-r--r-- | tests/pycurl_object_test.py | 9 | ||||
-rw-r--r-- | tests/reload_test.py | 1 | ||||
-rw-r--r-- | tests/reset_test.py | 5 | ||||
-rw-r--r-- | tests/setopt_lifecycle_test.py | 1 | ||||
-rw-r--r-- | tests/setopt_unicode_test.py | 4 | ||||
-rw-r--r-- | tests/share_test.py | 8 | ||||
-rw-r--r-- | tests/socket_open_test.py | 4 | ||||
-rw-r--r-- | tests/write_cb_bogus_test.py | 1 | ||||
-rw-r--r-- | winbuild.py | 2 |
24 files changed, 24 insertions, 49 deletions
diff --git a/examples/linksys.py b/examples/linksys.py index 3c6f837..0bf4a45 100644 --- a/examples/linksys.py +++ b/examples/linksys.py @@ -32,7 +32,7 @@ # # By Eric S. Raymond, August April 2003. All rites reversed. -import sys, re, copy, curl, exceptions +import sys, re, curl, exceptions def print_stderr(arg): sys.stderr.write(arg) @@ -99,7 +99,7 @@ class LinksysSession: return result def get_MAC_address(self, page, prefix): return self.screen_scrape("", prefix+r":[^M]*\(MAC Address: *([^)]*)") - def set_flag(page, flag, value): + def set_flag(self, page, flag, value): if value: self.actions.append(page, flag, "1") else: @@ -227,7 +227,6 @@ if __name__ == "__main__": cmd.Cmd.__init__(self) self.session = LinksysSession() if os.isatty(0): - import readline print("Type ? or `help' for help.") self.prompt = self.session.host + ": " else: @@ -533,7 +532,7 @@ requests should be forwarded to. Some ISPs may require you to set host and domain for use with dynamic-address allocation.""") - def help_wireless(self): + def help_wireless_desc(self): print("""\ The channel, ssid, ssid_broadcast, wep, and wireless commands control wireless routing.""") diff --git a/examples/retriever-multi.py b/examples/retriever-multi.py index 2daff11..0a49598 100644 --- a/examples/retriever-multi.py +++ b/examples/retriever-multi.py @@ -14,7 +14,6 @@ import pycurl # the libcurl tutorial for more info. try: import signal - from signal import SIGPIPE, SIG_IGN signal.signal(signal.SIGPIPE, signal.SIG_IGN) except ImportError: pass diff --git a/examples/retriever.py b/examples/retriever.py index cdfb91c..c8fb842 100644 --- a/examples/retriever.py +++ b/examples/retriever.py @@ -18,7 +18,6 @@ import pycurl # the libcurl tutorial for more info. try: import signal - from signal import SIGPIPE, SIG_IGN signal.signal(signal.SIGPIPE, signal.SIG_IGN) except ImportError: pass diff --git a/examples/sfquery.py b/examples/sfquery.py index b0836d0..0005748 100644 --- a/examples/sfquery.py +++ b/examples/sfquery.py @@ -11,7 +11,7 @@ # # By Eric S. Raymond, August 2002. All rites reversed. -import os, sys, netrc +import sys, netrc import curl class SourceForgeUserSession(curl.Curl): diff --git a/examples/tests/test_gtk.py b/examples/tests/test_gtk.py index 3aeebd6..fa4e868 100644 --- a/examples/tests/test_gtk.py +++ b/examples/tests/test_gtk.py @@ -12,7 +12,6 @@ import gtk # the libcurl tutorial for more info. try: import signal - from signal import SIGPIPE, SIG_IGN signal.signal(signal.SIGPIPE, signal.SIG_IGN) except ImportError: pass diff --git a/examples/xmlrpc_curl.py b/examples/xmlrpc_curl.py index 768198a..9b78daa 100644 --- a/examples/xmlrpc_curl.py +++ b/examples/xmlrpc_curl.py @@ -6,7 +6,6 @@ # the libcurl tutorial for more info. try: import signal - from signal import SIGPIPE, SIG_IGN signal.signal(signal.SIGPIPE, signal.SIG_IGN) except ImportError: pass diff --git a/python/curl/__init__.py b/python/curl/__init__.py index 07a3e50..e5aa40f 100644 --- a/python/curl/__init__.py +++ b/python/curl/__init__.py @@ -23,7 +23,6 @@ else: try: import signal - from signal import SIGPIPE, SIG_IGN signal.signal(signal.SIGPIPE, signal.SIG_IGN) except ImportError: pass @@ -8,7 +8,7 @@ PACKAGE = "pycurl" PY_PACKAGE = "curl" VERSION = "7.19.5.1" -import glob, os, re, sys, string, subprocess +import glob, os, re, sys, subprocess import distutils from distutils.core import setup from distutils.extension import Extension diff --git a/tests/app.py b/tests/app.py index 8444a24..bff8f56 100644 --- a/tests/app.py +++ b/tests/app.py @@ -18,7 +18,7 @@ def ok(): return 'success' @app.route('/short_wait') -def ok(): +def short_wait(): _time.sleep(0.1) return 'success' @@ -40,7 +40,7 @@ def raw_utf8(): return json.dumps(data) # XXX file is not a bottle FileUpload instance, but FieldStorage? -def convert_file(key, file): +def xconvert_file(key, file): return { 'key': key, 'name': file.name, @@ -87,7 +87,7 @@ def header(): # back into latin1 to obtain original bytestring, then decode it in utf-8. # Thanks to bdarnell for the idea: https://github.com/pycurl/pycurl/issues/124 @app.route('/header_utf8') -def header(): +def header_utf8(): header_value = bottle.request.headers[bottle.request.query['h']] if py3: # header_value is a string, headers are decoded in latin1 diff --git a/tests/curl_object_test.py b/tests/curl_object_test.py index 4b3e8da..5b028fb 100644 --- a/tests/curl_object_test.py +++ b/tests/curl_object_test.py @@ -19,9 +19,9 @@ class CurlObjectTest(unittest.TestCase): # positional arguments are rejected @nose.tools.raises(TypeError) def test_positional_arguments(self): - c = pycurl.Curl(1) + pycurl.Curl(1) # keyword arguments are rejected @nose.tools.raises(TypeError) def test_keyword_arguments(self): - c = pycurl.Curl(a=1) + pycurl.Curl(a=1) diff --git a/tests/internals_test.py b/tests/internals_test.py index 047969a..f6f7c7c 100644 --- a/tests/internals_test.py +++ b/tests/internals_test.py @@ -116,7 +116,7 @@ class InternalsTest(unittest.TestCase): else: assert False, "No exception when trying to copy a CurlMulti handle" - def test_copy_multi(self): + def test_copy_share(self): s = pycurl.CurlShare() try: copy.copy(s) diff --git a/tests/matrix/check-python.py b/tests/matrix/check-python.py index 63ac76c..862efed 100644 --- a/tests/matrix/check-python.py +++ b/tests/matrix/check-python.py @@ -1,2 +1,4 @@ import zlib import ssl + +dict(zlib=zlib, ssl=ssl) diff --git a/tests/multi_socket_select_test.py b/tests/multi_socket_select_test.py index 79f4e87..bd68849 100644 --- a/tests/multi_socket_select_test.py +++ b/tests/multi_socket_select_test.py @@ -67,7 +67,7 @@ class MultiSocketSelectTest(unittest.TestCase): m.add_handle(c) # get data - num_handles = len(m.handles) + #num_handles = len(m.handles) while (pycurl.E_CALL_MULTI_PERFORM==m.socket_all()[0]): pass diff --git a/tests/multi_test.py b/tests/multi_test.py index d4bf12c..ae9f606 100644 --- a/tests/multi_test.py +++ b/tests/multi_test.py @@ -371,9 +371,9 @@ class MultiTest(unittest.TestCase): # positional arguments are rejected @nose.tools.raises(TypeError) def test_positional_arguments(self): - c = pycurl.CurlMulti(1) + pycurl.CurlMulti(1) # keyword arguments are rejected @nose.tools.raises(TypeError) def test_keyword_arguments(self): - c = pycurl.CurlMulti(a=1) + pycurl.CurlMulti(a=1) diff --git a/tests/option_constants_test.py b/tests/option_constants_test.py index 3432514..08fb2d9 100644 --- a/tests/option_constants_test.py +++ b/tests/option_constants_test.py @@ -56,7 +56,7 @@ class OptionConstantsTest(unittest.TestCase): # CURL_REDIR_POST_303 was introduced in libcurl-7.26.0 @util.min_libcurl(7, 26, 0) - def test_postredir_flags(self): + def test_postredir_post_303(self): self.assertEqual(pycurl.REDIR_POST_303, pycurl.REDIR_POST_ALL & pycurl.REDIR_POST_303) # HTTPAUTH_DIGEST_IE was introduced in libcurl-7.19.3 diff --git a/tests/pycurl_object_test.py b/tests/pycurl_object_test.py index 7e5dcf3..cef1b0e 100644 --- a/tests/pycurl_object_test.py +++ b/tests/pycurl_object_test.py @@ -4,7 +4,6 @@ import pycurl import unittest -import sys class PycurlObjectTest(unittest.TestCase): def setUp(self): @@ -34,13 +33,13 @@ class PycurlObjectTest(unittest.TestCase): def test_get_attribute_multi(self): self.instantiate_and_check(self.check_get_attribute, 'CurlMulti') - def test_get_missing_attribute_curl(self): + def test_get_missing_attribute_curl_multi(self): self.instantiate_and_check(self.check_get_missing_attribute, 'CurlMulti') def test_delete_attribute_multi(self): self.instantiate_and_check(self.check_delete_attribute, 'CurlMulti') - def test_delete_missing_attribute_curl(self): + def test_delete_missing_attribute_curl_multi(self): self.instantiate_and_check(self.check_delete_missing_attribute, 'CurlMulti') def test_set_attribute_share(self): @@ -49,13 +48,13 @@ class PycurlObjectTest(unittest.TestCase): def test_get_attribute_share(self): self.instantiate_and_check(self.check_get_attribute, 'CurlShare') - def test_get_missing_attribute_curl(self): + def test_get_missing_attribute_curl_share(self): self.instantiate_and_check(self.check_get_missing_attribute, 'CurlShare') def test_delete_attribute_share(self): self.instantiate_and_check(self.check_delete_attribute, 'CurlShare') - def test_delete_missing_attribute_curl(self): + def test_delete_missing_attribute_curl_share(self): self.instantiate_and_check(self.check_delete_missing_attribute, 'CurlShare') def instantiate_and_check(self, fn, cls_name): diff --git a/tests/reload_test.py b/tests/reload_test.py index 2c62889..906a9dd 100644 --- a/tests/reload_test.py +++ b/tests/reload_test.py @@ -5,7 +5,6 @@ import pycurl import unittest import nose.plugins.attrib -import sys class ReloadTest(unittest.TestCase): @nose.plugins.attrib.attr('standalone') diff --git a/tests/reset_test.py b/tests/reset_test.py index f630814..4b5df38 100644 --- a/tests/reset_test.py +++ b/tests/reset_test.py @@ -4,11 +4,6 @@ import pycurl import unittest -import sys -try: - import urllib.parse as urllib_parse -except ImportError: - import urllib as urllib_parse from . import appmanager from . import util diff --git a/tests/setopt_lifecycle_test.py b/tests/setopt_lifecycle_test.py index 0c00bd0..08a6470 100644 --- a/tests/setopt_lifecycle_test.py +++ b/tests/setopt_lifecycle_test.py @@ -3,7 +3,6 @@ # vi:ts=4:et import gc -import os.path import pycurl import unittest try: diff --git a/tests/setopt_unicode_test.py b/tests/setopt_unicode_test.py index cb083e0..2fc48c4 100644 --- a/tests/setopt_unicode_test.py +++ b/tests/setopt_unicode_test.py @@ -5,10 +5,6 @@ import pycurl import unittest import nose.tools -try: - import json -except ImportError: - import simplejson as json from . import appmanager from . import util diff --git a/tests/share_test.py b/tests/share_test.py index a76d003..7ccc3b9 100644 --- a/tests/share_test.py +++ b/tests/share_test.py @@ -6,10 +6,6 @@ import threading import pycurl import unittest import nose.tools -try: - import urllib.parse as urllib_parse -except ImportError: - import urllib as urllib_parse from . import appmanager from . import util @@ -63,9 +59,9 @@ class ShareTest(unittest.TestCase): # positional arguments are rejected @nose.tools.raises(TypeError) def test_positional_arguments(self): - c = pycurl.CurlShare(1) + pycurl.CurlShare(1) # keyword arguments are rejected @nose.tools.raises(TypeError) def test_keyword_arguments(self): - c = pycurl.CurlShare(a=1) + pycurl.CurlShare(a=1) diff --git a/tests/socket_open_test.py b/tests/socket_open_test.py index 78a214c..b6dd8d1 100644 --- a/tests/socket_open_test.py +++ b/tests/socket_open_test.py @@ -5,10 +5,6 @@ import socket import pycurl import unittest -try: - import urllib.parse as urllib_parse -except ImportError: - import urllib as urllib_parse from . import appmanager from . import util diff --git a/tests/write_cb_bogus_test.py b/tests/write_cb_bogus_test.py index 6278ffd..7040d3a 100644 --- a/tests/write_cb_bogus_test.py +++ b/tests/write_cb_bogus_test.py @@ -28,7 +28,6 @@ class WriteAbortTest(unittest.TestCase): def check(self, write_cb): # download the script itself through the file:// protocol into write_cb - c = pycurl.Curl() self.curl.setopt(pycurl.URL, 'file://' + os.path.abspath(sys.argv[0])) self.curl.setopt(pycurl.WRITEFUNCTION, write_cb) try: diff --git a/winbuild.py b/winbuild.py index a5e72c9..fe45036 100644 --- a/winbuild.py +++ b/winbuild.py @@ -89,7 +89,7 @@ def step(step_fn, args, target_dir): state_file_path = os.path.join(state_path, step) if not os.path.exists(state_file_path) or not os.path.exists(target_dir): step_fn(*args) - with open(state_file_path, 'w') as f: + with open(state_file_path, 'w'): pass def untar(basename): |