watchman: refactor transport connecting to unconfuse pytype
Pytype sees `self.proc` as potentially `None` here, even though it's set by the
`_connect()` logic. Instead of asserting, simply use the process returned by
that method (which it sets into `self.proc` before returning, so there's no
functional change here).
--- a/hgext/fsmonitor/pywatchman/__init__.py Thu Jan 05 17:24:11 2023 -0500
+++ b/hgext/fsmonitor/pywatchman/__init__.py Thu Jan 05 17:28:33 2023 -0500
@@ -689,9 +689,9 @@
if self.closed:
self.close()
self.closed = False
- self._connect()
- res = self.proc.stdin.write(data)
- self.proc.stdin.close()
+ proc = self._connect()
+ res = proc.stdin.write(data)
+ proc.stdin.close()
self.closed = True
return res