Skip to content

Commit bb05ba8

Browse files
committed
recreate _IRODS_VERSION as function returning server compatibility tuple
1 parent 1aed89d commit bb05ba8

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

irods/helpers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def make_session(test_server_version=False, **kwargs):
5959
# is too recent. This is a way to ensure that tests don't fail due to a server mismatch.
6060
if test_server_version:
6161
connected_version = _get_server_version_for_test(session, curtail_length=3)
62-
advertised_version = _IRODS_VERSION[:3]
62+
advertised_version = _IRODS_VERSION()[:3]
6363
if connected_version > advertised_version:
6464
msg = (
6565
"Connected server is {connected_version}, "

irods/message/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ def ET(xml_type=(), server_version=None):
185185
# We avail ourselves of this macro in running tests to abort if the session has connected
186186
# to a server that is too new.
187187

188-
_IRODS_VERSION = (5, 0, 2, "d")
188+
# Deprecated. Not for use external to the library.
189+
IRODS_VERSION = (5, 0, 2, "d")
190+
191+
def _IRODS_VERSION():
192+
return IRODS_VERSION
189193

190194
UNICODE = str
191195

@@ -477,8 +481,8 @@ def __init__(self, proxy_user, client_user, application_name=""):
477481
self.connectCnt = 0
478482
self.proxyUser, self.proxyRcatZone = proxy_user
479483
self.clientUser, self.clientRcatZone = client_user
480-
self.relVersion = "rods{}.{}.{}".format(*_IRODS_VERSION)
481-
self.apiVersion = "{3}".format(*_IRODS_VERSION)
484+
self.relVersion = "rods{}.{}.{}".format(*_IRODS_VERSION())
485+
self.apiVersion = "{3}".format(*_IRODS_VERSION())
482486
self.option = application_name
483487

484488
irodsProt = IntegerProperty()

0 commit comments

Comments
 (0)