typing: disable [unsupported-operands] warning in the largefiles outgoing hook
authorMatt Harbison <matt_harbison@yahoo.com>
Thu, 05 Jan 2023 17:21:09 -0500
changeset 49936 cb3918e5bc77
parent 49935 e63ab79b2fa1
child 49937 36afe74e4439
typing: disable [unsupported-operands] warning in the largefiles outgoing hook For some reason, pytype thinks `toupload` is a set: No attribute '__setitem__' on Set[nothing] (It actually is a set in the subsequent `else` branch, but I'm not interested in trying to rewrite this to be consistent.)
hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py	Thu Jan 05 17:15:27 2023 -0500
+++ b/hgext/largefiles/overrides.py	Thu Jan 05 17:21:09 2023 -0500
@@ -1436,7 +1436,7 @@
 
             def addfunc(fn, lfhash):
                 if fn not in toupload:
-                    toupload[fn] = []
+                    toupload[fn] = []  # pytype: disable=unsupported-operands
                 toupload[fn].append(lfhash)
                 lfhashes.add(lfhash)