diff --git a/tornado/template.py b/tornado/template.py index e64b0296..cbb296a3 100644 --- a/tornado/template.py +++ b/tornado/template.py @@ -335,7 +335,7 @@ class Template(object): # __name__ and __loader__ allow the traceback mechanism to find # the generated source code. "__name__": self.name.replace('.', '_'), - "__loader__": ObjectDict(get_source=lambda name: self.code), # type: ignore + "__loader__": ObjectDict(get_source=lambda name: self.code), } namespace.update(self.namespace) namespace.update(kwargs) diff --git a/tornado/test/template_test.py b/tornado/test/template_test.py index ad5ac71e..dfcf3805 100644 --- a/tornado/test/template_test.py +++ b/tornado/test/template_test.py @@ -206,7 +206,7 @@ three{%end%} loader = DictLoader({ "base.html": "{% module Template('sub.html') %}", "sub.html": "{{1/0}}", - }, namespace={"_tt_modules": ObjectDict({"Template": lambda path, **kwargs: loader.load(path).generate(**kwargs)})}) + }, namespace={"_tt_modules": ObjectDict(Template=lambda path, **kwargs: loader.load(path).generate(**kwargs))}) try: loader.load("base.html").generate() self.fail("did not get expected exception") diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py index 7e417854..297b5e80 100644 --- a/tornado/test/web_test.py +++ b/tornado/test/web_test.py @@ -81,9 +81,9 @@ class CookieTestRequestHandler(RequestHandler): # don't call super.__init__ self._cookies = {} if key_version is None: - self.application = ObjectDict(settings=dict(cookie_secret=cookie_secret)) # type: ignore + self.application = ObjectDict(settings=dict(cookie_secret=cookie_secret)) else: - self.application = ObjectDict(settings=dict(cookie_secret=cookie_secret, # type: ignore + self.application = ObjectDict(settings=dict(cookie_secret=cookie_secret, key_version=key_version)) def get_cookie(self, name):