diff options
author | Federico Caselli <cfederico87@gmail.com> | 2021-10-25 15:45:42 -0400 |
---|---|---|
committer | sqla-tester <sqla-tester@sqlalchemy.org> | 2021-10-25 15:45:42 -0400 |
commit | 6055be01a1357ec3c13937c3aab28360b5e80ea3 (patch) | |
tree | b846c03c14e14c597fcb7c57f51698c6868a9c25 /mako/template.py | |
parent | 03c65d63d1df5835695a96ab7909e7086ba3dcf3 (diff) | |
download | mako-6055be01a1357ec3c13937c3aab28360b5e80ea3.tar.gz |
update black and format
Closes: #342
Pull-request: https://github.com/sqlalchemy/mako/pull/342
Pull-request-sha: 21a068103481410cf4856fb07c19146dc684d460
Change-Id: I9027433ec23ee19c9d9a47015e0327acf409e2d8
Diffstat (limited to 'mako/template.py')
-rw-r--r-- | mako/template.py | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/mako/template.py b/mako/template.py index df2a7ac..bbbe73c 100644 --- a/mako/template.py +++ b/mako/template.py @@ -483,17 +483,17 @@ class ModuleTemplate(Template): """A Template which is constructed given an existing Python module. - e.g.:: + e.g.:: - t = Template("this is a template") - f = file("mymodule.py", "w") - f.write(t.code) - f.close() + t = Template("this is a template") + f = file("mymodule.py", "w") + f.write(t.code) + f.close() - import mymodule + import mymodule - t = ModuleTemplate(mymodule) - print(t.render()) + t = ModuleTemplate(mymodule) + print(t.render()) """ @@ -579,7 +579,7 @@ class ModuleInfo: memory, provides reverse lookups of template source, module source code based on a module's identifier. - """ + """ _modules = weakref.WeakValueDictionary() @@ -642,9 +642,7 @@ class ModuleInfo: elif self.module._source_encoding and not isinstance( self.template_source, str ): - return self.template_source.decode( - self.module._source_encoding - ) + return self.template_source.decode(self.module._source_encoding) else: return self.template_source |