Drop Python 2 object subclassing (#38720)

This commit is contained in:
Adam J. Stewart
2023-07-05 07:37:44 -05:00
committed by GitHub
parent 8861fe0294
commit 95847a0b37
110 changed files with 233 additions and 233 deletions

View File

@@ -39,7 +39,7 @@
true_fn = lambda: True
class OpenFile(object):
class OpenFile:
"""Record for keeping track of open lockfiles (with reference counting).
There's really only one ``OpenFile`` per inode, per process, but we record the
@@ -53,7 +53,7 @@ def __init__(self, fh):
self.refs = 0
class OpenFileTracker(object):
class OpenFileTracker:
"""Track open lockfiles, to minimize number of open file descriptors.
The ``fcntl`` locks that Spack uses are associated with an inode and a process.
@@ -169,7 +169,7 @@ def _attempts_str(wait_time, nattempts):
return " after {} and {}".format(pretty_seconds(wait_time), attempts)
class LockType(object):
class LockType:
READ = 0
WRITE = 1
@@ -192,7 +192,7 @@ def is_valid(op):
return op == LockType.READ or op == LockType.WRITE
class Lock(object):
class Lock:
"""This is an implementation of a filesystem lock using Python's lockf.
In Python, ``lockf`` actually calls ``fcntl``, so this should work with
@@ -681,7 +681,7 @@ def _status_msg(self, locktype, status):
)
class LockTransaction(object):
class LockTransaction:
"""Simple nested transaction context manager that uses a file lock.
Arguments: