Mercurial > hg
comparison hgext/fsmonitor/pywatchman/pybser.py @ 48946:642e31cb55f0
py3: use class X: instead of class X(object):
The inheritance from object is implied in Python 3. So this should
be equivalent.
This change was generated via an automated search and replace. So there
may have been some accidental changes.
Differential Revision: https://phab.mercurial-scm.org/D12352
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 21 Feb 2022 13:08:28 -0700 |
parents | 6000f5b25c9b |
children | 59a72267f5ce |
comparison
equal
deleted
inserted
replaced
48945:55d132525155 | 48946:642e31cb55f0 |
---|---|
91 if compat.PYTHON3 and not isinstance(ret, bytes): | 91 if compat.PYTHON3 and not isinstance(ret, bytes): |
92 ret = bytes((ret,)) | 92 ret = bytes((ret,)) |
93 return ret | 93 return ret |
94 | 94 |
95 | 95 |
96 class _bser_buffer(object): | 96 class _bser_buffer: |
97 def __init__(self, version): | 97 def __init__(self, version): |
98 self.bser_version = version | 98 self.bser_version = version |
99 self.buf = ctypes.create_string_buffer(8192) | 99 self.buf = ctypes.create_string_buffer(8192) |
100 if self.bser_version == 1: | 100 if self.bser_version == 1: |
101 struct.pack_into( | 101 struct.pack_into( |
322 | 322 |
323 | 323 |
324 # This is a quack-alike with the bserObjectType in bser.c | 324 # This is a quack-alike with the bserObjectType in bser.c |
325 # It provides by getattr accessors and getitem for both index | 325 # It provides by getattr accessors and getitem for both index |
326 # and name. | 326 # and name. |
327 class _BunserDict(object): | 327 class _BunserDict: |
328 __slots__ = ("_keys", "_values") | 328 __slots__ = ("_keys", "_values") |
329 | 329 |
330 def __init__(self, keys, values): | 330 def __init__(self, keys, values): |
331 self._keys = keys | 331 self._keys = keys |
332 self._values = values | 332 self._values = values |
348 | 348 |
349 def __len__(self): | 349 def __len__(self): |
350 return len(self._keys) | 350 return len(self._keys) |
351 | 351 |
352 | 352 |
353 class Bunser(object): | 353 class Bunser: |
354 def __init__(self, mutable=True, value_encoding=None, value_errors=None): | 354 def __init__(self, mutable=True, value_encoding=None, value_errors=None): |
355 self.mutable = mutable | 355 self.mutable = mutable |
356 self.value_encoding = value_encoding | 356 self.value_encoding = value_encoding |
357 | 357 |
358 if value_encoding is None: | 358 if value_encoding is None: |