changeset 49860:d5116e4dc744

typing: disable an attribute-error warning in the journal extension The code is complicated enough that pytype doesn't realize that `name` can't be `None` if it is evaluated here.
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 05 Jan 2023 17:45:25 -0500
parents 8b369bcbadf1
children ffeeaeb2d142
files hgext/journal.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/journal.py	Fri Jan 06 12:20:09 2023 -0500
+++ b/hgext/journal.py	Thu Jan 05 17:45:25 2023 -0500
@@ -567,8 +567,12 @@
         )
         fm.write(b'newnodes', b'%s', formatnodes(entry.newhashes))
         fm.condwrite(ui.verbose, b'user', b' %-8s', entry.user)
+
+        # ``name`` is bytes, or None only if 'all' was an option.
         fm.condwrite(
+            # pytype: disable=attribute-error
             opts.get(b'all') or name.startswith(b're:'),
+            # pytype: enable=attribute-error
             b'name',
             b'  %-8s',
             entry.name,