diff options
| author | Gael Pasgrimaud <gael@gawel.org> | 2012-12-05 13:19:05 +0100 |
|---|---|---|
| committer | Gael Pasgrimaud <gael@gawel.org> | 2012-12-05 13:19:05 +0100 |
| commit | 26655c765c3d11e1e4e09930f93fde953dea25e2 (patch) | |
| tree | 73036ac592fb3f21d8ce1f60b7fe8293405ce1f4 /webtest/ext.py | |
| parent | 4b8c15c08d48843cb64ff7ac0f0c0870c246890a (diff) | |
| download | webtest-26655c765c3d11e1e4e09930f93fde953dea25e2.tar.gz | |
remove some ugly stuff by using future's literal and six. this mean we do no longer support python2.5
Diffstat (limited to 'webtest/ext.py')
| -rw-r--r-- | webtest/ext.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/webtest/ext.py b/webtest/ext.py index 6473c0e..91599ec 100644 --- a/webtest/ext.py +++ b/webtest/ext.py @@ -5,8 +5,7 @@ from webtest.sel import _free_port from webtest.sel import WSGIApplication from webtest.sel import WSGIServer from webtest.sel import WSGIRequestHandler -from webtest.compat import HTTPConnection -from webtest.compat import CannotSendRequest +from six.moves import http_client from webtest.compat import to_bytes from webtest.compat import to_string from contextlib import contextmanager @@ -48,13 +47,13 @@ class TestApp(testapp.TestApp): app.thread = threading.Thread(target=run) app.thread.start() - conn = HTTPConnection(ip, port) + conn = http_client.HTTPConnection(ip, port) time.sleep(.5) for i in range(100): try: conn.request('GET', '/__application__') conn.getresponse() - except (socket.error, CannotSendRequest): + except (socket.error, http_client.CannotSendRequest): time.sleep(.3) else: break @@ -71,7 +70,7 @@ class TestApp(testapp.TestApp): def close(self): """Close WSGI server if needed""" if self.app: - conn = HTTPConnection(*self.app.bind) + conn = http_client.HTTPConnection(*self.app.bind) for i in range(100): try: conn.request('GET', '/__kill_application__') |
