Skip to content

Commit

Permalink
Use tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
VRSEN committed Apr 29, 2024
1 parent 15ce5ec commit 6b72077
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions agency_swarm/agents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,11 +618,11 @@ def get_class_folder_path(self):
try:
# First, try to use the __file__ attribute of the module
return os.path.abspath(os.path.dirname(self.__module__.__file__))
except AttributeError or OSError or TypeError:
except (TypeError, OSError, AttributeError) as e:
# If that fails, fall back to inspect
try:
class_file = inspect.getfile(self.__class__)
except TypeError or OSError or AttributeError:
except (TypeError, OSError, AttributeError) as e:
return "./"
return os.path.abspath(os.path.realpath(os.path.dirname(class_file)))

Expand Down

0 comments on commit 6b72077

Please sign in to comment.