From: Ben Darnell Date: Fri, 18 May 2018 18:01:03 +0000 (-0400) Subject: Fix lint checks X-Git-Tag: v5.1.0b1~15^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2390%2Fhead;p=thirdparty%2Ftornado.git Fix lint checks This was being run from the wrong directory in CI so some errors had slipped in. --- diff --git a/.travis.yml b/.travis.yml index ee980cb8a..4a91d36e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,9 +38,9 @@ install: - travis_retry pip install codecov virtualenv # Create a separate no-dependencies virtualenv to make sure all imports # of optional-dependencies are guarded. - - virtualenv ./nodeps - - ./nodeps/bin/python -VV - - ./nodeps/bin/python setup.py install + - virtualenv /tmp/nodeps + - /tmp/nodeps/bin/python -VV + - /tmp/nodeps/bin/python setup.py install - curl-config --version; pip freeze script: @@ -76,13 +76,13 @@ script: - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then python $TARGET --resolver=tornado.platform.twisted.TwistedResolver; fi - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then python $TARGET --ioloop=tornado.ioloop.PollIOLoop --ioloop_time_monotonic; fi #- if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then python $TARGET --resolver=tornado.platform.caresresolver.CaresResolver; fi - - if [[ $TRAVIS_PYTHON_VERSION != 'pypy3' ]]; then ../nodeps/bin/python -m tornado.test.runtests; fi + - if [[ $TRAVIS_PYTHON_VERSION != 'pypy3' ]]; then /tmp/nodeps/bin/python -m tornado.test.runtests; fi # make coverage reports for Codecov to find - if [[ "$RUN_COVERAGE" == 1 ]]; then coverage xml; fi - export TORNADO_EXTENSION=0 - if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then cd ../docs && mkdir sphinx-out && sphinx-build -E -n -W -b html . sphinx-out; fi - if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then cd ../docs && mkdir sphinx-doctest-out && sphinx-build -E -n -b doctest . sphinx-out; fi - - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then flake8; fi + - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then cd .. && flake8; fi after_success: # call codecov from project root diff --git a/demos/blog/blog.py b/demos/blog/blog.py index b3f61fa2f..5da9e3fc0 100755 --- a/demos/blog/blog.py +++ b/demos/blog/blog.py @@ -130,7 +130,8 @@ class BaseHandler(tornado.web.RequestHandler): # self.current_user in prepare instead. user_id = self.get_secure_cookie("blogdemo_user") if user_id: - self.current_user = await self.queryone("SELECT * FROM authors WHERE id = %s", int(user_id)) + self.current_user = await self.queryone("SELECT * FROM authors WHERE id = %s", + int(user_id)) async def any_author_exists(self): return bool(await self.query("SELECT * FROM authors LIMIT 1")) diff --git a/tornado/locks.py b/tornado/locks.py index ae492345d..9566a4573 100644 --- a/tornado/locks.py +++ b/tornado/locks.py @@ -459,7 +459,7 @@ class Lock(object): A Lock can be used as an async context manager with the ``async with`` statement: - >>> from tornado import gen, locks + >>> from tornado import locks >>> lock = locks.Lock() >>> >>> async def f(): diff --git a/tornado/web.py b/tornado/web.py index 3d6a3e198..f970bd130 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -542,9 +542,9 @@ class RequestHandler(object): Newly-set cookies are not immediately visible via `get_cookie`; they are not present until the next request. - + expires may be a numeric timestamp as returned by `time.time`, - a time tuple as returned by `time.gmtime`, or a + a time tuple as returned by `time.gmtime`, or a `datetime.datetime` object. Additional keyword arguments are set on the cookies.Morsel diff --git a/tornado/websocket.py b/tornado/websocket.py index 87119bdc7..6e5b10300 100644 --- a/tornado/websocket.py +++ b/tornado/websocket.py @@ -32,7 +32,7 @@ from tornado.escape import utf8, native_str, to_unicode from tornado import gen, httpclient, httputil from tornado.ioloop import IOLoop, PeriodicCallback from tornado.iostream import StreamClosedError -from tornado.log import gen_log, app_log +from tornado.log import gen_log from tornado import simple_httpclient from tornado.queues import Queue from tornado.tcpclient import TCPClient