Esempio n. 1
0
=============================================

Friendly aims to provide friendlier feedback when an exception
is raised than what is done by Python.
This file contains only examples of SyntaxError and its sub-classes.
Some tests may appear to be repetitive to a human reader
but they are may be included to ensure more complete test coverage..

.. note::

     The content of this page is generated by running
     {name} located in the ``tests/`` directory.
     This needs to be done explicitly, independently of updating the
     documentation using Sphinx.
     On Windows, if Sphinx is installed on your computer, it is suggested
     instead to run make_trb.bat in the root directory as it will create
     similar files for all languages *and* update the documentation.

Friendly version: {friendly}
Python version: {python}

""".format(
    friendly=friendly.__version__,
    python=platform.python_version(),
    name=__file__,
)

print(f"Python version: {platform.python_version()}; English")

trb_syntax_common.create_tracebacks(target, intro_text)
Esempio n. 2
0
target = os.path.normpath(
    os.path.join(docs_root_dir, "docs/source/tracebacks_syntax_markdown.md"))

intro_text = """
# Syntax errors - markdown_docs format

<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The content of this page is generated by running
{name} located in the <code class="docutils literal notranslate"><span class="pre">tests/</span></code> directory.
This needs to be done explicitly, independently of updating the
documentation using Sphinx.
</p>
</div>

Friendly version: {friendly}
Python version: {python}

""".format(
    friendly=friendly.version.doc_version(),
    python=platform.python_version(),
    name=__file__,
)

print(f"Python version: {platform.python_version()}; --- markdown format")

trb_syntax_common.create_tracebacks(target,
                                    intro_text,
                                    formatter="markdown_docs")