Mercurial > public > mercurial-scm > hg
comparison mercurial/dispatch.py @ 51811:460e80488cf0
typing: lock in correct changes from pytype 2023.04.11 -> 2023.06.16
There were a handful of other changes to the pyi files generated when updating
pytype locally (and jumping from python 3.8.0 to python 3.10.11), but they were
not as clear (e.g. the embedded type in a list changing from `nothing` to `Any`
or similar). These looked obviously correct, and agreed with PyCharm's thoughts
on the signatures.
Oddly, even though pytype starting inferring `obsutil._getfilteredreason()` as
returning bytes, it (correctly) complained about the None path when it was typed
that way. Instead, raise a ProgrammingError if an unhandled fate is calculated.
(Currently, all possibilities are handled, so this isn't reachable unless
another fate is added in the future.)
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 20 Aug 2024 18:30:47 -0400 |
parents | 82131be5258e |
children | 607e94e01851 |
comparison
equal
deleted
inserted
replaced
51810:f1ef512e14ab | 51811:460e80488cf0 |
---|---|
83 self.prereposetups = prereposetups or [] | 83 self.prereposetups = prereposetups or [] |
84 | 84 |
85 # store the parsed and canonical command | 85 # store the parsed and canonical command |
86 self.canonical_command = None | 86 self.canonical_command = None |
87 | 87 |
88 def _runexithandlers(self): | 88 def _runexithandlers(self) -> None: |
89 exc = None | 89 exc = None |
90 handlers = self.ui._exithandlers | 90 handlers = self.ui._exithandlers |
91 try: | 91 try: |
92 while handlers: | 92 while handlers: |
93 func, args, kwargs = handlers.pop() | 93 func, args, kwargs = handlers.pop() |
237 if ret and not status: | 237 if ret and not status: |
238 status = ret | 238 status = ret |
239 return status | 239 return status |
240 | 240 |
241 | 241 |
242 def _rundispatch(req): | 242 def _rundispatch(req) -> int: |
243 with tracing.log('dispatch._rundispatch'): | 243 with tracing.log('dispatch._rundispatch'): |
244 if req.ferr: | 244 if req.ferr: |
245 ferr = req.ferr | 245 ferr = req.ferr |
246 elif req.ui: | 246 elif req.ui: |
247 ferr = req.ui.ferr | 247 ferr = req.ui.ferr |