File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -267,3 +267,24 @@ def _request_and_deserialize(
267267 raise NoContentError (target_type )
268268 deserialized = TypeAdapter (target_type ).validate_python (response .json ())
269269 return deserialized
270+
271+
272+ # https://github.com/DiamondLightSource/blueapi/issues/1256 - remove before 2.0
273+ def __getattr__ (name : str ):
274+ import warnings
275+
276+ renames = {
277+ "UnauthorisedAccess" : UnauthorisedAccessError ,
278+ "NoContent" : NoContentError ,
279+ "InvalidParameters" : InvalidParametersError ,
280+ }
281+ rename = renames .get (name )
282+ if rename is not None :
283+ warnings .warn (
284+ DeprecationWarning (
285+ f"{ name !r} is deprecated, use { rename .__name__ !r} instead"
286+ ),
287+ stacklevel = 2 ,
288+ )
289+ return rename
290+ raise AttributeError (f"module { __name__ !r} has no attribute { name !r} " )
Original file line number Diff line number Diff line change @@ -323,3 +323,22 @@ def load(self) -> C:
323323
324324class MissingStompConfigurationError (Exception ):
325325 pass
326+
327+
328+ # https://github.com/DiamondLightSource/blueapi/issues/1256 - remove before 2.0
329+ def __getattr__ (name : str ):
330+ import warnings
331+
332+ renames = {
333+ "MissingStompConfiguration" : MissingStompConfigurationError ,
334+ }
335+ rename = renames .get (name )
336+ if rename is not None :
337+ warnings .warn (
338+ DeprecationWarning (
339+ f"{ name !r} is deprecated, use { rename .__name__ !r} instead"
340+ ),
341+ stacklevel = 2 ,
342+ )
343+ return rename
344+ raise AttributeError (f"module { __name__ !r} has no attribute { name !r} " )
You can’t perform that action at this time.
0 commit comments