Skip to content
Snippets Groups Projects
Commit a0674e91 authored by Gregory Szorc's avatar Gregory Szorc
Browse files

worker: silence type error when calling pickle

pytype is complaining that the argument to `pickle.load()` is not an
`IO`. pytype isn't wrong: `_blockingreader` doesn't implement
`io.RawIOBase`, only `read()` and `readline()`. But it appears this is
enough for pickle. So we silence the false positive.

This fixes a regression introduced by D12304 /
cc0e059d2af8: worker: remove Python 2 support code.

Differential Revision: https://phab.mercurial-scm.org/D12337
parent 46b3ecfb
No related branches found
No related tags found
1 merge request!168branching: merge default into stable
......@@ -279,4 +279,7 @@
while openpipes > 0:
for key, events in selector.select():
try:
# The pytype error likely goes away on a modern version of
# pytype having a modern typeshed snapshot.
# pytype: disable=wrong-arg-types
res = pickle.load(_blockingreader(key.fileobj))
......@@ -282,4 +285,5 @@
res = pickle.load(_blockingreader(key.fileobj))
# pytype: enable=wrong-arg-types
if hasretval and res[0]:
retval.update(res[1])
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment