Skip to content

Commit

Permalink
Del (object) from 50 inc wa/xml_voip_validator/constraints_operator…
Browse files Browse the repository at this point in the history
…s.py

Summary: Python3 makes the use of `(object)` in class inheritance unnecessary. Let's modernize our code by eliminating this.

Reviewed By: palmje

Differential Revision: D48718329

fbshipit-source-id: c6a24d879de97c1f37cce14e3cfecc6c44c8413b
  • Loading branch information
r-barnes authored and facebook-github-bot committed Aug 27, 2023
1 parent a7f52e7 commit 7a308a4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion watchman/integration/lib/TempDir.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
global_temp_dir = None


class TempDir(object):
class TempDir:
"""
This is a helper for locating a reasonable place for temporary files.
When run in the watchman test suite, we compute this up-front and then
Expand Down
2 changes: 1 addition & 1 deletion watchman/integration/lib/WatchmanEdenTestCase.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def is_buck_build():
def can_run_eden():
return False

class WatchmanEdenTestCase(object):
class WatchmanEdenTestCase:
pass

else:
Expand Down
6 changes: 3 additions & 3 deletions watchman/integration/lib/WatchmanInstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def mergeTestConfig(config):
return {**test_config, **(config or {})}


class InitWithFilesMixin(object):
class InitWithFilesMixin:
def _init_state(self) -> None:
# pyre-fixme[16]: `InitWithFilesMixin` has no attribute `base_dir`.
self.base_dir = tempfile.mkdtemp(prefix="inst")
Expand Down Expand Up @@ -87,7 +87,7 @@ def get_state_args(self):
]


class InitWithDirMixin(object):
class InitWithDirMixin:
"""A mixin to allow setting up a state dir rather than a state file. This is
only meant to test state dir creation and permissions -- most operations are
unlikely to work.
Expand Down Expand Up @@ -121,7 +121,7 @@ def get_state_args(self):
return ["--test-state-dir={0}".format(self.base_dir)]


class _Instance(object):
class _Instance:
# Tracks a running watchman instance. It is created with an
# overridden global configuration file; you may pass that
# in to the constructor
Expand Down
8 changes: 4 additions & 4 deletions watchman/python/pywatchman/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def is_named_pipe_path(path: str) -> bool:
return path.startswith("\\\\.\\pipe\\watchman")


class SockPath(object):
class SockPath:
"""Describes how to connect to watchman"""

unix_domain = None
Expand Down Expand Up @@ -206,7 +206,7 @@ def legacy_sockpath(self):
return self.unix_domain


class Transport(object):
class Transport:
"""communication transport to the watchman server"""

buf = None
Expand Down Expand Up @@ -251,7 +251,7 @@ def readLine(self):
self.buf.append(b)


class Codec(object):
class Codec:
"""communication encoding for the watchman server"""

transport = None
Expand Down Expand Up @@ -824,7 +824,7 @@ def send(self, *args):
self.transport.write(cmd + b"\n")


class client(object):
class client:
"""Handles the communication with the watchman service"""

sockpath = None
Expand Down
6 changes: 3 additions & 3 deletions watchman/python/pywatchman/pybser.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _buf_pos(buf, pos) -> bytes:
return ret


class _bser_buffer(object):
class _bser_buffer:
def __init__(self, version):
self.bser_version = version
self.buf = ctypes.create_string_buffer(8192)
Expand Down Expand Up @@ -264,7 +264,7 @@ def dumps(obj, version: int = 1, capabilities: int = 0):
# This is a quack-alike with the bserObjectType in bser.c
# It provides by getattr accessors and getitem for both index
# and name.
class _BunserDict(object):
class _BunserDict:
__slots__ = ("_keys", "_values")

def __init__(self, keys, values):
Expand All @@ -290,7 +290,7 @@ def __len__(self):
return len(self._keys)


class Bunser(object):
class Bunser:
def __init__(self, mutable=True, value_encoding=None, value_errors=None):
self.mutable = mutable
self.value_encoding = value_encoding
Expand Down
2 changes: 1 addition & 1 deletion watchman/python/pywatchman/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def __init__(self, code: int) -> None:
)


class WindowsSocketHandle(object):
class WindowsSocketHandle:
AF_UNIX = 1
SOCK_STREAM = 1

Expand Down

0 comments on commit 7a308a4

Please sign in to comment.