[GRASS-git] [OSGeo/grass] be451c: grass.gunittest: Add the module name as an excepti...

Vaclav Petras noreply at github.com
Tue Jul 14 01:27:46 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: be451c43496529ce15626b4bb141df6028183302
      https://github.com/OSGeo/grass/commit/be451c43496529ce15626b4bb141df6028183302
  Author: Vaclav Petras <wenzeslaus at gmail.com>
  Date:   2026-07-14 (Tue, 14 Jul 2026)

  Changed paths:
    M python/grass/gunittest/loader.py

  Log Message:
  -----------
  grass.gunittest: Add the module name as an exception note (#7689)

The test loader raised a new ImportError to say which module could not be
imported. The message used e.message, which does not exist in Python 3, so
the handler raised AttributeError instead of the intended error.

Add the module name as a note to the original error instead. From the Python
documentation of BaseException.add_note(): Add the string note to the
exception's notes which appear in the standard traceback after the exception
string. The traceback then shows both the import error and the module name.

Exception notes need Python 3.11, which is now the minimum version.



To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications


More information about the grass-commit mailing list