File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/service-library/src/servicelib/fastapi Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class SingletonInAppStateMixin:
1515
1616 @classmethod
1717 def get_from_app_state (cls : type [T ], app : FastAPI ) -> T :
18- return getattr (app .state , cls .app_state_name )
18+ return getattr (app .state , cls .app_state_name ) # type:ignore[no-any-return]
1919
2020 def set_to_app_state (self , app : FastAPI ):
2121 if (exists := getattr (app .state , self .app_state_name , None )) and self .frozen :
@@ -26,11 +26,11 @@ def set_to_app_state(self, app: FastAPI):
2626 return self .get_from_app_state (app )
2727
2828 @classmethod
29- def pop_from_app_state (cls : type [T ], app : FastAPI ) -> None :
29+ def pop_from_app_state (cls : type [T ], app : FastAPI ) -> T :
3030 """
3131 Raises:
3232 AttributeError: if instance is not in app.state
3333 """
34- old = getattr ( app . state , cls .app_state_name )
34+ old = cls .get_from_app_state ( app )
3535 delattr (app .state , cls .app_state_name )
3636 return old
You can’t perform that action at this time.
0 commit comments