# HG changeset patch
# User Matt Harbison <
matt_h...@yahoo.com>
# Date 1730499620 14400
# Fri Nov 01 18:20:20 2024 -0400
# Branch stable
# Node ID cc7ff0c9089d8a1598c8696ac974771210284af7
# Parent 043700ffd1c55ce211136fe9eedd20de55131fd2
# EXP-Topic py2-to-py3-annotations
typing: correct a few missing `Optional` types where `None` is the default arg
These were caught by running the current pytype in CI (2023.11.21), but using
`PYTHON_VERSION=3.11` instead of the current default of 3.8. Running with 3.11
requires converting all of the py2 style comments to py3 style annotations, but
these are easy enough to fix first.
diff --git a/contrib/nautilus-thg.py b/contrib/nautilus-thg.py
--- a/contrib/nautilus-thg.py
+++ b/contrib/nautilus-thg.py
@@ -153,7 +153,7 @@
return None
def run_dialog(self, menuitem, hgtkcmd, cwd = None, files = None):
- # type: (Any, Text, Optional[Text], List[Text]) -> None
+ # type: (Any, Text, Optional[Text], Optional[List[Text]]) -> None
'''
hgtkcmd - hgtk subcommand
'''
diff --git a/tortoisehg/hgqt/tag.py b/tortoisehg/hgqt/tag.py
--- a/tortoisehg/hgqt/tag.py
+++ b/tortoisehg/hgqt/tag.py
@@ -57,7 +57,7 @@
class TagDialog(QDialog):
def __init__(self, repoagent, tag=b'', rev='tip', parent=None, opts=None):
- # type: (RepoAgent, bytes, Text, Optional[QWidget], Dict[Text, Union[bool, bytes]]) -> None
+ # type: (RepoAgent, bytes, Text, Optional[QWidget], Optional[Dict[Text, Union[bool, bytes]]]) -> None
super(TagDialog, self).__init__(parent)
if opts is None:
opts = {}