Mercurial > hg
view mercurial/templates/spartan/notfound.tmpl @ 45047:40120de810ba stable
demandimport: ignore `lzma` module for demandimport
This makes importing the module fail if the `_lzma` module is not present.
This makes e.g. tarfile correctly recognize if LZMA support is not present. It
changes the exception
File "/usr/lib/python3.6/tarfile.py", line 1694, in xzopen
fileobj = lzma.LZMAFile(fileobj or name, mode, preset=preset)
AttributeError: module 'lzma' has no attribute 'LZMAFile'
to the more correct exception
File "/usr/lib/python3.6/tarfile.py", line 1692, in xzopen
raise CompressionError("lzma module is not available")
tarfile.CompressionError: lzma module is not available
Also, it prevents that the error "abort: No module named '_lzma'!" is shown when
a development warning is to be shown. The reason why that happened is that for
showing the warning, we get information about the stack frames from the inspect
module, which accesses the `__file__` attribute of all modules in `sys.modules`
to build some cache, causing all modules (including `lzma`) to be imported.
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Wed, 08 Jul 2020 08:25:30 +0200 |
parents | 9409aeaafdc1 |
children |
line wrap: on
line source
{header} <title>Mercurial repository not found</title> </head> <body> <h2>Mercurial repository not found</h2> The specified repository "{repo|escape}" is unknown, sorry. Please go back to the <a href="{url|urlescape}">main repository list page</a>. {footer}