Skip to content

Commit

Permalink
fix SharedPV.current()
Browse files Browse the repository at this point in the history
regression from 23e26ca
  • Loading branch information
mdavidsaver committed Jul 25, 2023
1 parent e949f14 commit 2d312a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/p4p/server/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
4 changes: 4 additions & 0 deletions src/p4p/test/test_sharedpv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 2d312a1

Please sign in to comment.