]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix lint checks 2390/head
authorBen Darnell <ben@bendarnell.com>
Fri, 18 May 2018 18:01:03 +0000 (14:01 -0400)
committerBen Darnell <ben@bendarnell.com>
Fri, 18 May 2018 18:24:55 +0000 (14:24 -0400)
This was being run from the wrong directory in CI so some errors had
slipped in.

.travis.yml
demos/blog/blog.py
tornado/locks.py
tornado/web.py
tornado/websocket.py

index ee980cb8a1285348df6a77fa6d86d16d8795a9e8..4a91d36e33fec20a0b8622abdb799073cd065621 100644 (file)
@@ -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
index b3f61fa2f9fbf03848db04de34f1d11c430d8f09..5da9e3fc0bff45cb5cfb3d3c43ebc527335e33a8 100755 (executable)
@@ -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"))
index ae492345d3907978337a50d91ea085e2f19f14d8..9566a4573ca1423aa66cac22fc11c5099bd21d2c 100644 (file)
@@ -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():
index 3d6a3e198f3ade792d24249e7fc168fef349afb8..f970bd1306886319ff8eba6688326c0e2b6b578e 100644 (file)
@@ -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
index 87119bdc732b5da1736de7bec8c4e2f65108270c..6e5b103009224f2898d4c103e6483ef95f643ae0 100644 (file)
@@ -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