changeset 49939:ab32fd8412a7

typing: disable a few incorrect warnings in pywatchman The module-attr warnings are for things that only exist on Windows, and the wrong-keyword-args warning is due to a special case for a specific constructor. Both of these are properly conditionalized.
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 05 Jan 2023 17:31:11 -0500
parents 40d3ee570d83
children 8cb848601bec
files hgext/fsmonitor/pywatchman/__init__.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/fsmonitor/pywatchman/__init__.py	Thu Jan 05 17:28:33 2023 -0500
+++ b/hgext/fsmonitor/pywatchman/__init__.py	Thu Jan 05 17:31:11 2023 -0500
@@ -986,8 +986,12 @@
                 # if invoked via an application with graphical user interface,
                 # this call will cause a brief command window pop-up.
                 # Using the flag STARTF_USESHOWWINDOW to avoid this behavior.
+
+                # pytype: disable=module-attr
                 startupinfo = subprocess.STARTUPINFO()
                 startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
+                # pytype: enable=module-attr
+
                 args["startupinfo"] = startupinfo
 
             p = subprocess.Popen(cmd, **args)
@@ -1024,7 +1028,11 @@
         if self.transport == CLIProcessTransport:
             kwargs["binpath"] = self.binpath
 
+        # Only CLIProcessTransport has the binpath kwarg
+        # pytype: disable=wrong-keyword-args
         self.tport = self.transport(self.sockpath, self.timeout, **kwargs)
+        # pytype: enable=wrong-keyword-args
+
         self.sendConn = self.sendCodec(self.tport)
         self.recvConn = self.recvCodec(self.tport)
         self.pid = os.getpid()