Skip to content

Commit

Permalink
Fix AttributeError in debug mode by renaming logging.py (#82)
Browse files Browse the repository at this point in the history
Debugging the project in VSCode and Neovim using nvim-dap, triggered an
AttributeError ("AttributeError: partially initialized module 'logging'
has no attribute 'getLogger' (most likely due to a circular import)")
due to the local file logging.py shadowing the standard Python logging
module. The error occurred only while debugging.

Changes made:
- Renamed logging.py to logging_utils.py  
- Updated the import logging_utils statement

Co-authored-by: fs <fs@fs>
  • Loading branch information
filiso and fs authored Nov 17, 2024
1 parent b4f1f22 commit efb8126
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gptcli/gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
read_yaml_config,
)
from gptcli.providers.llama import init_llama_models
from gptcli.logging import LoggingChatListener
from gptcli.logging_utils import LoggingChatListener
from gptcli.cost import PriceChatListener
from gptcli.session import ChatSession
from gptcli.shell import execute, simple_response
Expand Down
File renamed without changes.

0 comments on commit efb8126

Please sign in to comment.