Pārlūkot izejas kodu

no Class(object) in py3

Thomas Waldmann 10 gadi atpakaļ
vecāks
revīzija
fec5572836
6 mainītis faili ar 11 papildinājumiem un 11 dzēšanām
  1. 1 1
      attic/cache.py
  2. 1 1
      attic/key.py
  3. 3 3
      attic/remote.py
  4. 2 2
      attic/repository.py
  5. 1 1
      attic/testsuite/helpers.py
  6. 3 3
      attic/testsuite/key.py

+ 1 - 1
attic/cache.py

@@ -10,7 +10,7 @@ from .helpers import Error, get_cache_dir, decode_dict, st_mtime_ns, unhexlify,
 from .hashindex import ChunkIndex
 
 
-class Cache(object):
+class Cache:
     """Client Side cache
     """
     class RepositoryReplay(Error):

+ 1 - 1
attic/key.py

@@ -44,7 +44,7 @@ def key_factory(repository, manifest_data):
         raise UnsupportedPayloadError(manifest_data[0])
 
 
-class KeyBase(object):
+class KeyBase:
 
     def __init__(self):
         self.TYPE_STR = bytes([self.TYPE])

+ 3 - 3
attic/remote.py

@@ -23,7 +23,7 @@ class PathNotAllowed(Error):
     """Repository path not allowed"""
 
 
-class RepositoryServer(object):
+class RepositoryServer:
 
     def __init__(self, restrict_to_paths):
         self.repository = None
@@ -78,7 +78,7 @@ class RepositoryServer(object):
         return self.repository.id
 
 
-class RemoteRepository(object):
+class RemoteRepository:
     extra_test_args = []
 
     class RPCError(Exception):
@@ -312,4 +312,4 @@ class RepositoryCache:
 def cache_if_remote(repository):
     if isinstance(repository, RemoteRepository):
         return RepositoryCache(repository)
-    return repository
+    return repository

+ 2 - 2
attic/repository.py

@@ -19,7 +19,7 @@ TAG_DELETE = 1
 TAG_COMMIT = 2
 
 
-class Repository(object):
+class Repository:
     """Filesystem based transactional key value store
 
     On disk layout:
@@ -378,7 +378,7 @@ class Repository(object):
         """
 
 
-class LoggedIO(object):
+class LoggedIO:
 
     header_fmt = struct.Struct('<IIB')
     assert header_fmt.size == 9

+ 1 - 1
attic/testsuite/helpers.py

@@ -125,7 +125,7 @@ class UpgradableLockTestCase(AtticTestCase):
         lock.release()
 
 
-class MockArchive(object):
+class MockArchive:
 
     def __init__(self, ts):
         self.ts = ts

+ 3 - 3
attic/testsuite/key.py

@@ -11,7 +11,7 @@ from attic.helpers import Location, unhexlify
 
 class KeyTestCase(AtticTestCase):
 
-    class MockArgs(object):
+    class MockArgs:
         repository = Location(tempfile.mkstemp()[1])
 
     keyfile2_key_file = """
@@ -37,8 +37,8 @@ class KeyTestCase(AtticTestCase):
     def tearDown(self):
         shutil.rmtree(self.tmppath)
 
-    class MockRepository(object):
-        class _Location(object):
+    class MockRepository:
+        class _Location:
             orig = '/some/place'
 
         _location = _Location()