diff --git a/src/p4p/server/raw.py b/src/p4p/server/raw.py index eb4ef1e3..2629f780 100644 --- a/src/p4p/server/raw.py +++ b/src/p4p/server/raw.py @@ -179,7 +179,7 @@ def post(self, value, **kws): def current(self): V = _SharedPV.current(self) try: - return self._unwrap() + return self._unwrap(V) except: # py3 will chain automatically, py2 won't raise ValueError("Unable to unwrap %r with %r"%(V, self._unwrap)) diff --git a/src/p4p/test/test_sharedpv.py b/src/p4p/test/test_sharedpv.py index ed4bcf17..a810ba32 100644 --- a/src/p4p/test/test_sharedpv.py +++ b/src/p4p/test/test_sharedpv.py @@ -67,6 +67,10 @@ def tearDown(self): self.assertListEqual(R, [None] * len(R)) super(TestGPM, self).tearDown() + def testCurrent(self): + self.pv.open(1.0) + self.assertEqual(self.pv.current(), 1.0) + def testGet(self): with Context('pva', conf=self.server.conf(), useenv=False) as ctxt: _log.debug('Client conf: %s', ctxt.conf())