From bd0576b68a87813361a95b6a32d5b14f5583bb9e Mon Sep 17 00:00:00 2001 From: Jason Paryani Date: Tue, 16 Jun 2015 11:47:13 -0700 Subject: [PATCH] Add warnings for using old restorer methods --- capnp/lib/capnp.pyx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/capnp/lib/capnp.pyx b/capnp/lib/capnp.pyx index eb6696a..8d84517 100644 --- a/capnp/lib/capnp.pyx +++ b/capnp/lib/capnp.pyx @@ -2221,6 +2221,7 @@ cdef class TwoPartyClient: self.thisptr = new RpcSystem(makeRpcClient(deref(self._network.thisptr))) self._restorer = None else: + _warnings.warn('Restorers are deprecated. Please use the new bootstrap methods.', UserWarning) self._restorer = _convert_restorer(restorer) self.thisptr = new RpcSystem(makeRpcClientWithRestorer(deref(self._network.thisptr), deref(self._restorer.thisptr))) @@ -2248,6 +2249,7 @@ cdef class TwoPartyClient: return sock cpdef restore(self, objectId) except +reraise_kj_exception: + _warnings.warn('Restorers are deprecated. Please use the new bootstrap methods.', UserWarning) cdef _MessageBuilder builder cdef _MessageReader reader cdef _DynamicObjectBuilder object_builder @@ -2326,6 +2328,7 @@ cdef class TwoPartyServer: schema = bootstrap.schema self.thisptr = new RpcSystem(makeRpcServerBootstrap(deref(self._network.thisptr), helpers.server_to_client(schema.thisptr, bootstrap))) elif restorer: + _warnings.warn('Restorers are deprecated. Please use the new bootstrap methods.', UserWarning) self._restorer = _convert_restorer(restorer) self.thisptr = new RpcSystem(makeRpcServer(deref(self._network.thisptr), deref(self._restorer.thisptr)))