diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-08-01 13:17:37 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-08-02 11:07:45 +0200 |
| commit | daa68a6dd14aec331d6e539cccce9bbae678faf6 (patch) | |
| tree | a2a5dc152c8deee0307b32ca2aa3669c1ddfdf3d /tools/example_gallery/main.py | |
| parent | 9aa0225352cada0c7957f4310b9be9d3d0922f56 (diff) | |
Fix example_gallery tool failure
Fix paths in chapter6-plugins.pyproject.
Amends 5fbdfa3ec1df74368316ab0f3ab2ec03781e0df0.
As a drive-by, improve error reporting in the tool.
Task-number: PYSIDE-1878
Change-Id: Ib692946ebc4168785bba7f6dd39268fd9ea4e30d
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'tools/example_gallery/main.py')
| -rw-r--r-- | tools/example_gallery/main.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/example_gallery/main.py b/tools/example_gallery/main.py index a34210722..35e09bce3 100644 --- a/tools/example_gallery/main.py +++ b/tools/example_gallery/main.py @@ -15,6 +15,7 @@ since there is no special requirements. import json import math import shutil +import sys from argparse import ArgumentParser, RawTextHelpFormatter from pathlib import Path from textwrap import dedent @@ -135,7 +136,12 @@ def get_code_tabs(files, project_dir): with open(_path, "r") as _f: _file_content = remove_licenses(_f.read()) except UnicodeDecodeError as e: - print(f"example_gallery: error decoding {_path}:{e}") + print(f"example_gallery: error decoding {project_dir}/{_path}:{e}", + file=sys.stderr) + raise + except FileNotFoundError as e: + print(f"example_gallery: error opening {project_dir}/{_path}:{e}", + file=sys.stderr) raise content += add_indent(_file_content, 2) |
