Skip to content

Commit

Permalink
Remove default typing argument in PACKAGE file] [batch:140/146] [shar…
Browse files Browse the repository at this point in the history
…d:2/N]

Reviewed By: MaggieMoss

Differential Revision: D65462475

fbshipit-source-id: 685a4843b07338d170cd8d7fcc9b3d414014120b
  • Loading branch information
generatedunixname89002005307016 authored and facebook-github-bot committed Nov 5, 2024
1 parent b28e7a8 commit e193167
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion watchman/python/pywatchman/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

# Demandimport causes modules to be loaded lazily. Force the load now
# so that we can fall back on pybser if bser doesn't exist
# pyre-ignore
bser.pdu_info
except ImportError:
from . import pybser as bser
Expand Down
2 changes: 0 additions & 2 deletions watchman/python/pywatchman/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def load(fp, mutable: bool = True, value_encoding=None, value_errors=None):
if read_len < len(header):
return None

# pyre-fixme[16]: Module `pywatchman` has no attribute `bser`.
total_len = bser.pdu_len(buf)
if total_len > len(buf):
ctypes.resize(buf, total_len)
Expand All @@ -75,7 +74,6 @@ def load(fp, mutable: bool = True, value_encoding=None, value_errors=None):
if read_len < len(body):
raise RuntimeError("bser data ended early")

# pyre-fixme[16]: Module `pywatchman` has no attribute `bser`.
return bser.loads(
(ctypes.c_char * total_len).from_buffer(buf, 0),
mutable,
Expand Down
6 changes: 5 additions & 1 deletion watchman/python/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@
)


# pyre-fixme[16]: Module `pywatchman` has no attribute `bser`.
if os.path.basename(bser.__file__) == "pybser.py":
raise Exception(
"bser module resolved to pybser! Something is broken in your build. __file__={!r}, sys.path={!r}".format(
bser.__file__, sys.path
# pyre-fixme[16]: Module `pywatchman` has no attribute `bser`.
bser.__file__,
sys.path,
)
)

Expand Down Expand Up @@ -433,6 +436,7 @@ def t(ex: bytes):
try:
document = b"\x00\x01\x05" + struct.pack("@i", len(ex)) + ex
print("encoded", document)
# pyre-fixme[16]: `TestBSERDump` has no attribute `bser_mod`.
self.bser_mod.loads(document)
except Exception:
# Exceptions are okay - abort is not.
Expand Down

0 comments on commit e193167

Please sign in to comment.