Skip to content

Commit 9bce884

Browse files
committed
deprecate IRODS_VERSION
1 parent 5998514 commit 9bce884

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

irods/message/__init__.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import os
1515
import ast
1616
import threading
17+
from warnings import warn
1718
from .message import Message
1819
from .property_types import (
1920
BinaryProperty,
@@ -185,11 +186,18 @@ def ET(xml_type=(), server_version=None):
185186
# We avail ourselves of this macro in running tests to abort if the session has connected
186187
# to a server that is too new.
187188

189+
# The symbol 'IRODS_VERSION' was for internal use in testing only, so it should be prefixed
190+
# with an underline.
191+
188192
_IRODS_VERSION = (5, 0, 2, "d")
189193

190-
# This alias exists as a backward-compatible duplicate, but it is slated for deprecation.
191-
# The symbol is for internal use in testing only, so it should be prefixed with an underline.
192-
IRODS_VERSION = _IRODS_VERSION
194+
_deprecated_names = {"IRODS_VERSION": _IRODS_VERSION}
195+
196+
def __getattr__(name):
197+
if name in _deprecated_names:
198+
warn(f"{name} is deprecated", DeprecationWarning)
199+
return _deprecated_names[name]
200+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
193201

194202
UNICODE = str
195203

0 commit comments

Comments
 (0)