Commit db547993 authored by Jason Madden's avatar Jason Madden

Make all classes new-style. This is especially good for PyPy

See https://github.com/zopefoundation/ZODB/pull/160 for rationale.

Also restore PyPy to the build matrix.
parent 0218f626
...@@ -4,6 +4,8 @@ matrix: ...@@ -4,6 +4,8 @@ matrix:
include: include:
- os: linux - os: linux
python: 2.7 python: 2.7
- os: linux
python: pypy-5.4.1
- os: linux - os: linux
python: 3.4 python: 3.4
- os: linux - os: linux
......
...@@ -4,7 +4,9 @@ Changelog ...@@ -4,7 +4,9 @@ Changelog
5.1.1 (unreleased) 5.1.1 (unreleased)
------------------ ------------------
- Nothing changed yet. - All classes are new-style classes on Python 2 (they were already
new-style on Python 3). This improves performance on PyPy. See
`issue 86 <<https://github.com/zopefoundation/ZEO/pull/86>`_.
5.1.0 (2017-04-03) 5.1.0 (2017-04-03)
......
...@@ -75,7 +75,7 @@ registered_methods = set(( 'get_info', 'lastTransaction', ...@@ -75,7 +75,7 @@ registered_methods = set(( 'get_info', 'lastTransaction',
'iterator_next', 'iterator_record_start', 'iterator_record_next', 'iterator_next', 'iterator_record_start', 'iterator_record_next',
'iterator_gc', 'server_status', 'set_client_label', 'ping')) 'iterator_gc', 'server_status', 'set_client_label', 'ping'))
class ZEOStorage: class ZEOStorage(object):
"""Proxy to underlying storage for a single remote client.""" """Proxy to underlying storage for a single remote client."""
connected = connection = stats = storage = storage_id = transaction = None connected = connection = stats = storage = storage_id = transaction = None
...@@ -616,7 +616,7 @@ class ZEOStorage: ...@@ -616,7 +616,7 @@ class ZEOStorage:
def ping(self): def ping(self):
pass pass
class StorageServerDB: class StorageServerDB(object):
"""Adapter from StorageServerDB to ZODB.interfaces.IStorageWrapper """Adapter from StorageServerDB to ZODB.interfaces.IStorageWrapper
This is used in a ZEO fan-out situation, where a storage server This is used in a ZEO fan-out situation, where a storage server
...@@ -642,7 +642,7 @@ class StorageServerDB: ...@@ -642,7 +642,7 @@ class StorageServerDB:
transform_record_data = untransform_record_data = lambda self, data: data transform_record_data = untransform_record_data = lambda self, data: data
class StorageServer: class StorageServer(object):
"""The server side implementation of ZEO. """The server side implementation of ZEO.
...@@ -952,7 +952,7 @@ class StorageServer: ...@@ -952,7 +952,7 @@ class StorageServer:
return dict((storage_id, self.server_status(storage_id)) return dict((storage_id, self.server_status(storage_id))
for storage_id in self.storages) for storage_id in self.storages)
class StubTimeoutThread: class StubTimeoutThread(object):
def begin(self, client): def begin(self, client):
pass pass
...@@ -1067,7 +1067,7 @@ def _addr_label(addr): ...@@ -1067,7 +1067,7 @@ def _addr_label(addr):
host, port = addr host, port = addr
return str(host) + ":" + str(port) return str(host) + ":" + str(port)
class CommitLog: class CommitLog(object):
def __init__(self): def __init__(self):
self.file = tempfile.TemporaryFile(suffix=".comit-log") self.file = tempfile.TemporaryFile(suffix=".comit-log")
...@@ -1109,7 +1109,7 @@ class CommitLog: ...@@ -1109,7 +1109,7 @@ class CommitLog:
self.file.close() self.file.close()
self.file = None self.file = None
class ServerEvent: class ServerEvent(object):
def __init__(self, server, **kw): def __init__(self, server, **kw):
self.__dict__.update(kw) self.__dict__.update(kw)
......
...@@ -27,7 +27,7 @@ import ZODB.blob ...@@ -27,7 +27,7 @@ import ZODB.blob
from ZEO._compat import Pickler, Unpickler from ZEO._compat import Pickler, Unpickler
class TransactionBuffer: class TransactionBuffer(object):
# The TransactionBuffer is used by client storage to hold update # The TransactionBuffer is used by client storage to hold update
# data until the tpc_finish(). It is only used by a single # data until the tpc_finish(). It is only used by a single
......
...@@ -47,7 +47,7 @@ else: ...@@ -47,7 +47,7 @@ else:
if zeo_dist is not None: if zeo_dist is not None:
zeo_version = zeo_dist.version zeo_version = zeo_dist.version
class StorageStats: class StorageStats(object):
"""Per-storage usage statistics.""" """Per-storage usage statistics."""
def __init__(self, connections=None): def __init__(self, connections=None):
......
...@@ -63,7 +63,7 @@ def windows_shutdown_handler(): ...@@ -63,7 +63,7 @@ def windows_shutdown_handler():
import asyncore import asyncore
asyncore.close_all() asyncore.close_all()
class ZEOOptionsMixin: class ZEOOptionsMixin(object):
storages = None storages = None
...@@ -72,7 +72,7 @@ class ZEOOptionsMixin: ...@@ -72,7 +72,7 @@ class ZEOOptionsMixin:
def handle_filename(self, arg): def handle_filename(self, arg):
from ZODB.config import FileStorage # That's a FileStorage *opener*! from ZODB.config import FileStorage # That's a FileStorage *opener*!
class FSConfig: class FSConfig(object):
def __init__(self, name, path): def __init__(self, name, path):
self._name = name self._name = name
self.path = path self.path = path
...@@ -138,7 +138,7 @@ class ZEOOptions(ZDOptions, ZEOOptionsMixin): ...@@ -138,7 +138,7 @@ class ZEOOptions(ZDOptions, ZEOOptionsMixin):
break break
class ZEOServer: class ZEOServer(object):
def __init__(self, options): def __init__(self, options):
self.options = options self.options = options
......
...@@ -47,7 +47,7 @@ def parse_line(line): ...@@ -47,7 +47,7 @@ def parse_line(line):
m = meth_name, tuple(meth_args) m = meth_name, tuple(meth_args)
return t, m return t, m
class TStats: class TStats(object):
counter = 1 counter = 1
...@@ -73,7 +73,7 @@ class TStats: ...@@ -73,7 +73,7 @@ class TStats:
print(self.fmt % (time.ctime(self.begin), d_vote, d_finish, print(self.fmt % (time.ctime(self.begin), d_vote, d_finish,
self.user, self.url)) self.user, self.url))
class TransactionParser: class TransactionParser(object):
def __init__(self): def __init__(self):
self.txns = {} self.txns = {}
......
...@@ -79,7 +79,7 @@ def parse_time(line): ...@@ -79,7 +79,7 @@ def parse_time(line):
return int(time.mktime(date_l + time_l + [0, 0, 0])) return int(time.mktime(date_l + time_l + [0, 0, 0]))
class Txn: class Txn(object):
"""Track status of single transaction.""" """Track status of single transaction."""
def __init__(self, tid): def __init__(self, tid):
self.tid = tid self.tid = tid
...@@ -98,7 +98,7 @@ class Txn: ...@@ -98,7 +98,7 @@ class Txn:
class Status: class Status(object):
"""Track status of ZEO server by replaying log records. """Track status of ZEO server by replaying log records.
We want to keep track of several events: We want to keep track of several events:
......
...@@ -96,7 +96,7 @@ def parse_line(line): ...@@ -96,7 +96,7 @@ def parse_line(line):
class StoreStat: class StoreStat(object):
def __init__(self, when, oid, size): def __init__(self, when, oid, size):
self.when = when self.when = when
self.oid = oid self.oid = oid
...@@ -109,7 +109,7 @@ class StoreStat: ...@@ -109,7 +109,7 @@ class StoreStat:
raise IndexError raise IndexError
class TxnStat: class TxnStat(object):
def __init__(self): def __init__(self):
self._begintime = None self._begintime = None
self._finishtime = None self._finishtime = None
...@@ -173,7 +173,7 @@ class ReplayTxn(TxnStat): ...@@ -173,7 +173,7 @@ class ReplayTxn(TxnStat):
class ZEOParser: class ZEOParser(object):
def __init__(self, maxtxns=-1, report=1, storage=None): def __init__(self, maxtxns=-1, report=1, storage=None):
self.__txns = [] self.__txns = []
self.__curtxn = {} self.__curtxn = {}
......
...@@ -17,7 +17,7 @@ from ZODB.Connection import TransactionMetaData ...@@ -17,7 +17,7 @@ from ZODB.Connection import TransactionMetaData
from ZODB.tests.MinPO import MinPO from ZODB.tests.MinPO import MinPO
from ZODB.tests.StorageTestBase import zodb_unpickle from ZODB.tests.StorageTestBase import zodb_unpickle
class TransUndoStorageWithCache: class TransUndoStorageWithCache(object):
def checkUndoInvalidation(self): def checkUndoInvalidation(self):
oid = self._storage.new_oid() oid = self._storage.new_oid()
......
...@@ -26,7 +26,7 @@ from ZEO.tests.TestThread import TestThread ...@@ -26,7 +26,7 @@ from ZEO.tests.TestThread import TestThread
ZERO = b'\0'*8 ZERO = b'\0'*8
class DummyDB: class DummyDB(object):
def invalidate(self, *args, **kwargs): def invalidate(self, *args, **kwargs):
pass pass
...@@ -68,7 +68,7 @@ class WorkerThread(TestThread): ...@@ -68,7 +68,7 @@ class WorkerThread(TestThread):
self.ready.set() self.ready.set()
future.result(9) future.result(9)
class CommitLockTests: class CommitLockTests(object):
NUM_CLIENTS = 5 NUM_CLIENTS = 5
......
...@@ -51,7 +51,7 @@ class TestClientStorage(ClientStorage): ...@@ -51,7 +51,7 @@ class TestClientStorage(ClientStorage):
self.connection_count_for_tests += 1 self.connection_count_for_tests += 1
self.verify_result = conn.verify_result self.verify_result = conn.verify_result
class DummyDB: class DummyDB(object):
def invalidate(self, *args, **kwargs): def invalidate(self, *args, **kwargs):
pass pass
...@@ -416,7 +416,7 @@ class ConnectionTests(CommonSetupTearDown): ...@@ -416,7 +416,7 @@ class ConnectionTests(CommonSetupTearDown):
def checkBadMessage2(self): def checkBadMessage2(self):
# just like a real message, but with an unpicklable argument # just like a real message, but with an unpicklable argument
global Hack global Hack
class Hack: class Hack(object):
pass pass
msg = encode(1, 0, "foo", (Hack(),)) msg = encode(1, 0, "foo", (Hack(),))
...@@ -1106,7 +1106,7 @@ try: ...@@ -1106,7 +1106,7 @@ try:
except (socket.error, AttributeError): except (socket.error, AttributeError):
pass pass
else: else:
class V6Setup: class V6Setup(object):
def _getAddr(self): def _getAddr(self):
return '::1', forker.get_port(self) return '::1', forker.get_port(self)
......
...@@ -59,7 +59,7 @@ class FailableThread(TestThread): ...@@ -59,7 +59,7 @@ class FailableThread(TestThread):
raise raise
class StressTask: class StressTask(object):
# Append integers startnum, startnum + step, startnum + 2*step, ... # Append integers startnum, startnum + step, startnum + 2*step, ...
# to 'tree'. If sleep is given, sleep # to 'tree'. If sleep is given, sleep
# that long after each append. At the end, instance var .added_keys # that long after each append. At the end, instance var .added_keys
...@@ -234,7 +234,7 @@ class LargeUpdatesThread(FailableThread): ...@@ -234,7 +234,7 @@ class LargeUpdatesThread(FailableThread):
self.added_keys = keys_added.keys() self.added_keys = keys_added.keys()
cn.close() cn.close()
class InvalidationTests: class InvalidationTests(object):
# Minimum # of seconds the main thread lets the workers run. The # Minimum # of seconds the main thread lets the workers run. The
# test stops as soon as this much time has elapsed, and all threads # test stops as soon as this much time has elapsed, and all threads
......
...@@ -21,7 +21,7 @@ from ZODB.Connection import TransactionMetaData ...@@ -21,7 +21,7 @@ from ZODB.Connection import TransactionMetaData
from ..asyncio.testing import AsyncRPC from ..asyncio.testing import AsyncRPC
class IterationTests: class IterationTests(object):
def _assertIteratorIdsEmpty(self): def _assertIteratorIdsEmpty(self):
# Account for the need to run a GC collection # Account for the need to run a GC collection
......
...@@ -71,7 +71,7 @@ class GetsThroughBeginThread(BasicThread): ...@@ -71,7 +71,7 @@ class GetsThroughBeginThread(BasicThread):
self.gotValueError = 1 self.gotValueError = 1
class ThreadTests: class ThreadTests(object):
# Thread 1 should start a transaction, but not get all the way through it. # Thread 1 should start a transaction, but not get all the way through it.
# Main thread should close the connection. Thread 1 should then get # Main thread should close the connection. Thread 1 should then get
# disconnected. # disconnected.
......
...@@ -64,7 +64,7 @@ class StorageServerError(StorageError): ...@@ -64,7 +64,7 @@ class StorageServerError(StorageError):
"""Error reported when an unpicklable exception is raised.""" """Error reported when an unpicklable exception is raised."""
class ZEOStorage: class ZEOStorage(object):
"""Proxy to underlying storage for a single remote client.""" """Proxy to underlying storage for a single remote client."""
# A list of extension methods. A subclass with extra methods # A list of extension methods. A subclass with extra methods
...@@ -758,7 +758,7 @@ class ZEOStorage: ...@@ -758,7 +758,7 @@ class ZEOStorage:
def set_client_label(self, label): def set_client_label(self, label):
self.log_label = str(label)+' '+_addr_label(self.connection.addr) self.log_label = str(label)+' '+_addr_label(self.connection.addr)
class StorageServerDB: class StorageServerDB(object):
def __init__(self, server, storage_id): def __init__(self, server, storage_id):
self.server = server self.server = server
...@@ -776,7 +776,7 @@ class StorageServerDB: ...@@ -776,7 +776,7 @@ class StorageServerDB:
transform_record_data = untransform_record_data = lambda self, data: data transform_record_data = untransform_record_data = lambda self, data: data
class StorageServer: class StorageServer(object):
"""The server side implementation of ZEO. """The server side implementation of ZEO.
...@@ -1328,7 +1328,7 @@ def _level_for_waiting(waiting): ...@@ -1328,7 +1328,7 @@ def _level_for_waiting(waiting):
else: else:
return logging.DEBUG return logging.DEBUG
class StubTimeoutThread: class StubTimeoutThread(object):
def begin(self, client): def begin(self, client):
pass pass
...@@ -1434,7 +1434,7 @@ class SlowMethodThread(threading.Thread): ...@@ -1434,7 +1434,7 @@ class SlowMethodThread(threading.Thread):
self.delay.reply(result) self.delay.reply(result)
class ClientStub: class ClientStub(object):
def __init__(self, rpc): def __init__(self, rpc):
self.rpc = rpc self.rpc = rpc
...@@ -1494,7 +1494,7 @@ class ClientStub308(ClientStub): ...@@ -1494,7 +1494,7 @@ class ClientStub308(ClientStub):
def invalidateVerify(self, oid): def invalidateVerify(self, oid):
ClientStub.invalidateVerify(self, (oid, '')) ClientStub.invalidateVerify(self, (oid, ''))
class ZEOStorage308Adapter: class ZEOStorage308Adapter(object):
def __init__(self, storage): def __init__(self, storage):
self.storage = storage self.storage = storage
...@@ -1582,7 +1582,7 @@ def _addr_label(addr): ...@@ -1582,7 +1582,7 @@ def _addr_label(addr):
host, port = addr host, port = addr
return str(host) + ":" + str(port) return str(host) + ":" + str(port)
class CommitLog: class CommitLog(object):
def __init__(self): def __init__(self):
self.file = tempfile.TemporaryFile(suffix=".comit-log") self.file = tempfile.TemporaryFile(suffix=".comit-log")
...@@ -1624,7 +1624,7 @@ class CommitLog: ...@@ -1624,7 +1624,7 @@ class CommitLog:
self.file.close() self.file.close()
self.file = None self.file = None
class ServerEvent: class ServerEvent(object):
def __init__(self, server, **kw): def __init__(self, server, **kw):
self.__dict__.update(kw) self.__dict__.update(kw)
......
...@@ -22,7 +22,7 @@ from __future__ import print_function ...@@ -22,7 +22,7 @@ from __future__ import print_function
import os import os
from ..hash import sha1 from ..hash import sha1
class Client: class Client(object):
# Subclass should override to list the names of methods that # Subclass should override to list the names of methods that
# will be called on the server. # will be called on the server.
extensions = [] extensions = []
...@@ -37,7 +37,7 @@ def sort(L): ...@@ -37,7 +37,7 @@ def sort(L):
L.sort() L.sort()
return L return L
class Database: class Database(object):
"""Abstracts a password database. """Abstracts a password database.
This class is used both in the authentication process (via This class is used both in the authentication process (via
......
...@@ -14,7 +14,7 @@ def _strxor(s1, s2): ...@@ -14,7 +14,7 @@ def _strxor(s1, s2):
# hashing module used. # hashing module used.
digest_size = None digest_size = None
class HMAC: class HMAC(object):
"""RFC2104 HMAC class. """RFC2104 HMAC class.
This supports the API for Cryptographic Hash Functions (PEP 247). This supports the API for Cryptographic Hash Functions (PEP 247).
......
...@@ -47,7 +47,7 @@ else: ...@@ -47,7 +47,7 @@ else:
if zeo_dist is not None: if zeo_dist is not None:
zeo_version = zeo_dist.version zeo_version = zeo_dist.version
class StorageStats: class StorageStats(object):
"""Per-storage usage statistics.""" """Per-storage usage statistics."""
def __init__(self, connections=None): def __init__(self, connections=None):
......
...@@ -64,7 +64,7 @@ def windows_shutdown_handler(): ...@@ -64,7 +64,7 @@ def windows_shutdown_handler():
import asyncore import asyncore
asyncore.close_all() asyncore.close_all()
class ZEOOptionsMixin: class ZEOOptionsMixin(object):
storages = None storages = None
...@@ -76,7 +76,7 @@ class ZEOOptionsMixin: ...@@ -76,7 +76,7 @@ class ZEOOptionsMixin:
def handle_filename(self, arg): def handle_filename(self, arg):
from ZODB.config import FileStorage # That's a FileStorage *opener*! from ZODB.config import FileStorage # That's a FileStorage *opener*!
class FSConfig: class FSConfig(object):
def __init__(self, name, path): def __init__(self, name, path):
self._name = name self._name = name
self.path = path self.path = path
...@@ -145,7 +145,7 @@ class ZEOOptions(ZDOptions, ZEOOptionsMixin): ...@@ -145,7 +145,7 @@ class ZEOOptions(ZDOptions, ZEOOptionsMixin):
break break
class ZEOServer: class ZEOServer(object):
def __init__(self, options): def __init__(self, options):
self.options = options self.options = options
......
...@@ -17,7 +17,7 @@ def _strxor(s1, s2): ...@@ -17,7 +17,7 @@ def _strxor(s1, s2):
# hashing module used. # hashing module used.
digest_size = None digest_size = None
class HMAC: class HMAC(object):
"""RFC2104 HMAC class. """RFC2104 HMAC class.
This supports the API for Cryptographic Hash Functions (PEP 247). This supports the API for Cryptographic Hash Functions (PEP 247).
......
...@@ -536,7 +536,7 @@ class ConnectThread(threading.Thread): ...@@ -536,7 +536,7 @@ class ConnectThread(threading.Thread):
# TODO: should check deadline # TODO: should check deadline
class ConnectWrapper: class ConnectWrapper(object):
"""An object that handles the connection procedure for one socket. """An object that handles the connection procedure for one socket.
This is a little state machine with states: This is a little state machine with states:
......
...@@ -32,7 +32,7 @@ exception_type_type = type(Exception) ...@@ -32,7 +32,7 @@ exception_type_type = type(Exception)
debug_zrpc = False debug_zrpc = False
class Delay: class Delay(object):
"""Used to delay response to client for synchronous calls. """Used to delay response to client for synchronous calls.
When a synchronous call is made and the original handler returns When a synchronous call is made and the original handler returns
......
...@@ -41,7 +41,7 @@ skip_if_testing_client_against_zeo4 = ( ...@@ -41,7 +41,7 @@ skip_if_testing_client_against_zeo4 = (
(lambda func: func) (lambda func: func)
) )
class ZEOConfig: class ZEOConfig(object):
"""Class to generate ZEO configuration file. """ """Class to generate ZEO configuration file. """
def __init__(self, addr, log=None, **options): def __init__(self, addr, log=None, **options):
......
...@@ -33,7 +33,7 @@ import ZEO ...@@ -33,7 +33,7 @@ import ZEO
from . import forker from . import forker
class FileStorageConfig: class FileStorageConfig(object):
def getConfig(self, path, create, read_only): def getConfig(self, path, create, read_only):
return """\ return """\
<filestorage 1> <filestorage 1>
...@@ -44,7 +44,7 @@ class FileStorageConfig: ...@@ -44,7 +44,7 @@ class FileStorageConfig:
create and 'yes' or 'no', create and 'yes' or 'no',
read_only and 'yes' or 'no') read_only and 'yes' or 'no')
class MappingStorageConfig: class MappingStorageConfig(object):
def getConfig(self, path, create, read_only): def getConfig(self, path, create, read_only):
return """<mappingstorage 1/>""" return """<mappingstorage 1/>"""
......
...@@ -16,7 +16,7 @@ import unittest ...@@ -16,7 +16,7 @@ import unittest
import ZEO.asyncio.testing import ZEO.asyncio.testing
class FakeStorageBase: class FakeStorageBase(object):
def __getattr__(self, name): def __getattr__(self, name):
if name in ('getTid', 'history', 'load', 'loadSerial', if name in ('getTid', 'history', 'load', 'loadSerial',
...@@ -43,7 +43,7 @@ class FakeStorage(FakeStorageBase): ...@@ -43,7 +43,7 @@ class FakeStorage(FakeStorageBase):
return oid, oid*8, 'data ' + oid, next return oid, oid*8, 'data ' + oid, next
class FakeServer: class FakeServer(object):
storages = { storages = {
'1': FakeStorage(), '1': FakeStorage(),
'2': FakeStorageBase(), '2': FakeStorageBase(),
...@@ -55,7 +55,7 @@ class FakeServer: ...@@ -55,7 +55,7 @@ class FakeServer:
client_conflict_resolution = False client_conflict_resolution = False
class FakeConnection: class FakeConnection(object):
protocol_version = b'Z4' protocol_version = b'Z4'
addr = 'test' addr = 'test'
......
...@@ -61,7 +61,7 @@ from . import testssl ...@@ -61,7 +61,7 @@ from . import testssl
logger = logging.getLogger('ZEO.tests.testZEO') logger = logging.getLogger('ZEO.tests.testZEO')
class DummyDB: class DummyDB(object):
def invalidate(self, *args): def invalidate(self, *args):
pass pass
def invalidateCache(*unused): def invalidateCache(*unused):
...@@ -75,7 +75,7 @@ class CreativeGetState(persistent.Persistent): ...@@ -75,7 +75,7 @@ class CreativeGetState(persistent.Persistent):
return super(CreativeGetState, self).__getstate__() return super(CreativeGetState, self).__getstate__()
class MiscZEOTests: class MiscZEOTests(object):
"""ZEO tests that don't fit in elsewhere.""" """ZEO tests that don't fit in elsewhere."""
def checkCreativeGetState(self): def checkCreativeGetState(self):
...@@ -490,7 +490,7 @@ class ZRPCConnectionTests(ZEO.tests.ConnectionTests.CommonSetupTearDown): ...@@ -490,7 +490,7 @@ class ZRPCConnectionTests(ZEO.tests.ConnectionTests.CommonSetupTearDown):
self._storage = storage self._storage = storage
assert storage.is_connected() assert storage.is_connected()
class DummyDB: class DummyDB(object):
_invalidatedCache = 0 _invalidatedCache = 0
def invalidateCache(self): def invalidateCache(self):
self._invalidatedCache += 1 self._invalidatedCache += 1
...@@ -522,7 +522,7 @@ class ZRPCConnectionTests(ZEO.tests.ConnectionTests.CommonSetupTearDown): ...@@ -522,7 +522,7 @@ class ZRPCConnectionTests(ZEO.tests.ConnectionTests.CommonSetupTearDown):
self.assertEqual(db._invalidatedCache, base+1) self.assertEqual(db._invalidatedCache, base+1)
class CommonBlobTests: class CommonBlobTests(object):
def getConfig(self): def getConfig(self):
return """ return """
...@@ -706,7 +706,7 @@ class BlobWritableCacheTests(FullGenericTests, CommonBlobTests): ...@@ -706,7 +706,7 @@ class BlobWritableCacheTests(FullGenericTests, CommonBlobTests):
blob_cache_dir = 'blobs' blob_cache_dir = 'blobs'
shared_blob_dir = True shared_blob_dir = True
class FauxConn: class FauxConn(object):
addr = 'x' addr = 'x'
protocol_version = ZEO.asyncio.server.best_protocol_version protocol_version = ZEO.asyncio.server.best_protocol_version
peer_protocol_version = protocol_version peer_protocol_version = protocol_version
...@@ -718,7 +718,7 @@ class FauxConn: ...@@ -718,7 +718,7 @@ class FauxConn:
call_soon_threadsafe = async_threadsafe = async call_soon_threadsafe = async_threadsafe = async
class StorageServerWrapper: class StorageServerWrapper(object):
def __init__(self, server, storage_id): def __init__(self, server, storage_id):
self.storage_id = storage_id self.storage_id = storage_id
......
...@@ -75,7 +75,7 @@ will conflict. It will be blocked at the vote call. ...@@ -75,7 +75,7 @@ will conflict. It will be blocked at the vote call.
>>> zs2.storeBlobEnd(oid, serial, data, '1') >>> zs2.storeBlobEnd(oid, serial, data, '1')
>>> delay = zs2.vote('1') >>> delay = zs2.vote('1')
>>> class Sender: >>> class Sender(object):
... def send_reply(self, id, reply): ... def send_reply(self, id, reply):
... print('reply', id, reply) ... print('reply', id, reply)
... def send_error(self, id, err): ... def send_error(self, id, err):
......
...@@ -7,7 +7,7 @@ import unittest ...@@ -7,7 +7,7 @@ import unittest
from ZEO.runzeo import ZEOServer from ZEO.runzeo import ZEOServer
class TestStorageServer: class TestStorageServer(object):
def __init__(self, fail_create_server): def __init__(self, fail_create_server):
self.called = [] self.called = []
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import ZEO.StorageServer import ZEO.StorageServer
from ..asyncio.server import best_protocol_version from ..asyncio.server import best_protocol_version
class ServerProtocol: class ServerProtocol(object):
method = ('register', ) method = ('register', )
...@@ -30,7 +30,7 @@ class ServerProtocol: ...@@ -30,7 +30,7 @@ class ServerProtocol:
async_threadsafe = async async_threadsafe = async
class StorageServer: class StorageServer(object):
"""Create a client interface to a StorageServer. """Create a client interface to a StorageServer.
This is for testing StorageServer. It interacts with the storgr This is for testing StorageServer. It interacts with the storgr
......
...@@ -25,7 +25,7 @@ def parentdir(p, n=1): ...@@ -25,7 +25,7 @@ def parentdir(p, n=1):
n -= 1 n -= 1
return d return d
class Environment: class Environment(object):
"""Determine location of the Data.fs & ZEO_SERVER.pid files. """Determine location of the Data.fs & ZEO_SERVER.pid files.
Pass the argv[0] used to start ZEO to the constructor. Pass the argv[0] used to start ZEO to the constructor.
......
...@@ -49,7 +49,7 @@ def server_ssl(section): ...@@ -49,7 +49,7 @@ def server_ssl(section):
def client_ssl(section): def client_ssl(section):
return ssl_config(section, False) return ssl_config(section, False)
class ClientStorageConfig: class ClientStorageConfig(object):
def __init__(self, config): def __init__(self, config):
self.config = config self.config = config
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment