Make SimpleAsyncHTTPClient the default.

Get rid of the environment variable hack for selecting client
implementations.
This commit is contained in:
Ben Darnell 2011-02-23 14:51:35 -08:00
parent 9fc882a4ac
commit e42c99ffca
1 changed files with 2 additions and 14 deletions

View File

@ -87,20 +87,8 @@ class AsyncHTTPClient(object):
else:
if cls is AsyncHTTPClient:
if cls._impl_class is None:
# If the environment variable
# USE_SIMPLE_HTTPCLIENT is set to a non-empty
# string, use simple_httpclient instead of
# curl_httpclient. This is provided as a
# convenience for testing simple_httpclient, and
# may be removed or replaced with a better way of
# specifying the preferred HTTPClient
# implementation before the next release.
if os.environ.get("USE_SIMPLE_HTTPCLIENT"):
from tornado.simple_httpclient import SimpleAsyncHTTPClient
AsyncHTTPClient._impl_class = SimpleAsyncHTTPClient
else:
from tornado.curl_httpclient import CurlAsyncHTTPClient
AsyncHTTPClient._impl_class = CurlAsyncHTTPClient
from tornado.simple_httpclient import SimpleAsyncHTTPClient
AsyncHTTPClient._impl_class = SimpleAsyncHTTPClient
impl = cls._impl_class
else:
impl = cls