From 2fc1ec33558f6bf1849ea7ef13ee51ecc41f1272 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Thu, 2 Jul 2020 00:47:30 +0800 Subject: [PATCH] remove code deprecated in tornado 5 Tornado<5 has already been dropped. --- nvchecker/source/tornado_httpclient.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nvchecker/source/tornado_httpclient.py b/nvchecker/source/tornado_httpclient.py index 36930b3..6185e90 100644 --- a/nvchecker/source/tornado_httpclient.py +++ b/nvchecker/source/tornado_httpclient.py @@ -1,13 +1,11 @@ # MIT licensed -# Copyright (c) 2013-2017 lilydjwg , et al. +# Copyright (c) 2013-2020 lilydjwg , et al. import json from urllib.parse import urlencode from tornado.httpclient import AsyncHTTPClient, HTTPRequest, HTTPResponse from tornado.httpclient import HTTPError -from tornado.platform.asyncio import AsyncIOMainLoop, to_asyncio_future -AsyncIOMainLoop().install() try: import pycurl @@ -68,7 +66,7 @@ class ResponseManager: self.req = req async def __aenter__(self): - return await to_asyncio_future(client.fetch(self.req)) + return await client.fetch(self.req) async def __aexit__(self, exc_type, exc, tb): pass