From 5a2e5c79a6d2c2aae2a1019ce80b76a57526bb7a Mon Sep 17 00:00:00 2001 From: Joshua Lynch Date: Tue, 19 Nov 2019 09:51:31 -0500 Subject: [PATCH] set kwarg 'context' if pyepics version is less than 3.4.0 --- ophyd/_pyepics_shim.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ophyd/_pyepics_shim.py b/ophyd/_pyepics_shim.py index bbcbeb255..ba817a781 100644 --- a/ophyd/_pyepics_shim.py +++ b/ophyd/_pyepics_shim.py @@ -1,6 +1,6 @@ import atexit import ctypes -import epics +from distutils.version import LooseVersion import queue import threading import warnings @@ -20,6 +20,8 @@ def get_pv(*args, **kwargs): + if not LooseVersion(epics.__version__) >= LooseVersion('3.4.0'): + kwargs.setdefault('context', epics.ca.current_context()) return _get_pv(*args, **kwargs)