From 11edb84b43ffd0dbf7ddc7d3d66b15b363904325 Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Mon, 28 Dec 2015 12:30:14 +0000 Subject: [PATCH] Remove support for 2.6 and support for 3.5 This is a step in the direction of refactoring to modernity. --- .travis.yml | 2 +- README.md | 3 +-- setup.py | 2 +- wsgi_intercept/__init__.py | 2 +- wsgi_intercept/httplib2_intercept.py | 16 ++++------------ 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index a55010b..5eb5f3c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,9 @@ language: python python: - - 2.6 - 2.7 - 3.3 - 3.4 + - 3.5 script: make test install: diff --git a/README.md b/README.md index 5cfbbf3..f31b581 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ python3-wsgi-intercept [![travis](https://secure.travis-ci.org/cdent/python3-wsgi-intercept.png)](https://secure.travis-ci.org/cdent/python3-wsgi-intercept) Python3 port of the important bits of wsgi-intercept, now working for -2.6, 2.7, 3.3 and 3.4. +2.7, 3.3, 3.4 and 3.5. Documentation is available on [Read The Docs](http://wsgi-intercept.readthedocs.org/en/latest/). @@ -40,4 +40,3 @@ to keep in mind is that interceptor code from earlier versions, such as the interceptor for `mechanize` ought to work when imported independently (see [related conversation](https://github.com/cdent/wsgi-intercept/issues/16). - diff --git a/setup.py b/setup.py index adf59a2..ea8e30c 100644 --- a/setup.py +++ b/setup.py @@ -8,11 +8,11 @@ Intended Audience :: Developers License :: OSI Approved :: MIT License Operating System :: OS Independent Programming Language :: Python :: 2 -Programming Language :: Python :: 2.6 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 +Programming Language :: Python :: 3.5 Topic :: Internet :: WWW/HTTP :: WSGI Topic :: Software Development :: Testing """.strip().splitlines() diff --git a/wsgi_intercept/__init__.py b/wsgi_intercept/__init__.py index 0e36b5d..7fe1e2b 100644 --- a/wsgi_intercept/__init__.py +++ b/wsgi_intercept/__init__.py @@ -68,7 +68,7 @@ it into all of the *other* Python Web testing frameworks. The Python 2 version of wsgi-intercept was the result. Kumar McMillan later took over maintenance. -The current version works with Python 2.6, 2.7, 3.3 and 3.4 and was assembled +The current version works with Python 2.7, 3.3, 3.4 and 3.5 and was assembled by `Chris Dent`_. Testing and documentation improvements from `Sasha Hart`_. .. _twill: http://www.idyll.org/~t/www-tools/twill.html diff --git a/wsgi_intercept/httplib2_intercept.py b/wsgi_intercept/httplib2_intercept.py index ae7efce..da5d895 100644 --- a/wsgi_intercept/httplib2_intercept.py +++ b/wsgi_intercept/httplib2_intercept.py @@ -20,12 +20,8 @@ class HTTP_WSGIInterceptorWithTimeout(HTTPInterceptorMixin, # In Python3 strict is deprecated if sys.version_info[0] < 3: - try: - HTTPConnection.__init__(self, host, port=port, strict=strict, - timeout=timeout, source_address=source_address) - except TypeError: # Python 2.6 doesn't have source_address - HTTPConnection.__init__(self, host, port=port, strict=strict, - timeout=timeout) + HTTPConnection.__init__(self, host, port=port, strict=strict, + timeout=timeout, source_address=source_address) else: HTTPConnection.__init__(self, host, port=port, timeout=timeout, source_address=source_address) @@ -40,12 +36,8 @@ class HTTPS_WSGIInterceptorWithTimeout(HTTPSInterceptorMixin, # ignore proxy_info and ca_certs # In Python3 strict is deprecated if sys.version_info[0] < 3: - try: - HTTPSConnection.__init__(self, host, port=port, strict=strict, - timeout=timeout, source_address=source_address) - except TypeError: # Python 2.6 doesn't have source_address - HTTPSConnection.__init__(self, host, port=port, strict=strict, - timeout=timeout) + HTTPSConnection.__init__(self, host, port=port, strict=strict, + timeout=timeout, source_address=source_address) else: HTTPSConnection.__init__(self, host, port=port, timeout=timeout, source_address=source_address)