File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1414import os
1515import ast
1616import threading
17+ from warnings import warn
1718from .message import Message
1819from .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
194202UNICODE = str
195203
You can’t perform that action at this time.
0 commit comments