mojo: Fix pathname2url being moved to urllib.request in Python 3
urllib.pathname2url() in Python 2. urllib.request.pathname2url() in Python 3. Use a custom module name and import depending on Python version. Traceback (most recent call last): File "../../mojo/public/tools/bindings/mojom_bindings_generator.py", line 556, in <module> sys.exit(main()) File "../../mojo/public/tools/bindings/mojom_bindings_generator.py", line 551, in main return args.func(args, remaining_args) File "../../mojo/public/tools/bindings/mojom_bindings_generator.py", line 267, in _Generate processor._GenerateModule(args, remaining_args, generator_modules, File "../../mojo/public/tools/bindings/mojom_bindings_generator.py", line 199, in _GenerateModule imports[parsed_imp.import_filename] = self._GenerateModule( File "../../mojo/public/tools/bindings/mojom_bindings_generator.py", line 199, in _GenerateModule imports[parsed_imp.import_filename] = self._GenerateModule( File "../../mojo/public/tools/bindings/mojom_bindings_generator.py", line 238, in _GenerateModule generator.GenerateFiles(filtered_args) File "C:\Google\chromium\src\mojo\public\tools\bindings\generators\mojom_js_generator.py", line 369, in GenerateFiles self.WriteWithComment(self._GenerateAMDModule(), "%s.js" % self.module.path) File "C:\Google\chromium\src\mojo\public\tools\bindings\pylib\mojom\generate\template_expander.py", line 37, in GeneratorInternal return ApplyTemplate(args[0], path_to_template, parameters, **kwargs) File "C:\Google\chromium\src\mojo\public\tools\bindings\pylib\mojom\generate\template_expander.py", line 30, in ApplyTemplate return template.render(params) File "C:\Google\chromium\src\mojo\public\tools\bindings\pylib\mojom\generate\..\..\..\..\..\..\..\third_party\jinja2\asyncsupport.py", line 76, in render return original_render(self, *args, **kwargs) File "C:\Google\chromium\src\mojo\public\tools\bindings\pylib\mojom\generate\..\..\..\..\..\..\..\third_party\jinja2\environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "C:\Google\chromium\src\mojo\public\tools\bindings\pylib\mojom\generate\..\..\..\..\..\..\..\third_party\jinja2\environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "C:\Google\chromium\src\mojo\public\tools\bindings\pylib\mojom\generate\..\..\..\..\..\..\..\third_party\jinja2\_compat.py", line 37, in reraise raise value.with_traceback(tb) File "gen\mojo\public\tools\bindings\js_templates.zip\tmpl_3ded8450c36dc0f89ab9459f617a5a73f83f3d2a.py", line 29, in <module> File "C:\Google\chromium\src\mojo\public\tools\bindings\generators\mojom_js_generator.py", line 218, in GetRelativeUrl return urllib.pathname2url( AttributeError: module 'urllib' has no attribute 'pathname2url' Bug: 941669 Change-Id: Icc7b07a75ba172bef11a949e2e6f22f50a690ca6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2046170Reviewed-by:Ken Rockot <rockot@google.com> Commit-Queue: Raul Tambre <raul@tambre.ee> Cr-Commit-Position: refs/heads/master@{#740217}
Showing
Please register or sign in to comment