# HG changeset patch # User Matt Harbison # Date 2023-01-05 22:45:25 # Node ID d5116e4dc74459d81471ce046c480ac34d93f06b # Parent 8b369bcbadf1c6914e34bc49120d9189bc6a8bb9 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. diff --git a/hgext/journal.py b/hgext/journal.py --- a/hgext/journal.py +++ b/hgext/journal.py @@ -567,8 +567,12 @@ def journal(ui, repo, *args, **opts): ) 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,