Skip to content

Commit

Permalink
Fix: RecursionError in conf settings class when accessing unimplement…
Browse files Browse the repository at this point in the history
…ed settings (#540)

* Fix: RecursionError in conf settings class

Signed-off-by: Robert Unger <[email protected]>

* Add attribute error for unsupported settings

Signed-off-by: Bernd Verst <[email protected]>

---------

Signed-off-by: Robert Unger <[email protected]>
Signed-off-by: Bernd Verst <[email protected]>
Co-authored-by: Bernd Verst <[email protected]>
  • Loading branch information
ryou90 and berndverst authored May 3, 2023
1 parent a1aa2cb commit 033acbc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dapr/conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def __init__(self):
setattr(self, setting, env_variable or default_value)

def __getattr__(self, name):
if name not in dir(global_settings):
raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")
return getattr(self, name)


Expand Down

0 comments on commit 033acbc

Please sign in to comment.