Commit e680e622 authored by Raul Tambre's avatar Raul Tambre Committed by Commit Bot

template_expander: Use __name__ instead of func_name

func_name has been removed in Python 3.
__name__ does the same thing and exists in both Python 2 and 3.

Traceback (most recent call last):
  File "../../third_party/blink/renderer/build/scripts/make_document_policy_features.py", line 38, in <module>
    json5_generator.Maker(DocumentPolicyFeatureWriter).main()
  File "C:\Google\chromium\src\third_party\blink\renderer\build\scripts\json5_generator.py", line 337, in main
    writer = self._writer_class(args.files, args.output_dir)
  File "../../third_party/blink/renderer/build/scripts/make_document_policy_features.py", line 19, in __init__
    def generate_implementation():
  File "C:\Google\chromium\src\third_party\blink\renderer\build\scripts\template_expander.py", line 76, in real_decorator
    generator_internal.func_name = generator.func_name
AttributeError: 'function' object has no attribute 'func_name'

Bug: 941669
Change-Id: Idc9654bfb71c2a0a53448ad81e680c6f460c8c62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089842
Auto-Submit: Raul Tambre <raul@tambre.ee>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747444}
parent 99930ee2
...@@ -73,7 +73,7 @@ def use_jinja(template_path, filters=None, tests=None, template_cache=None): ...@@ -73,7 +73,7 @@ def use_jinja(template_path, filters=None, tests=None, template_cache=None):
tests=tests, tests=tests,
template_cache=template_cache) template_cache=template_cache)
generator_internal.func_name = generator.func_name generator_internal.__name__ = generator.__name__
return generator_internal return generator_internal
return real_decorator return real_decorator
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment