fix: resolve NameError and import pathing in main.py#389
Open
lokesh12344 wants to merge 1 commit intofireform-core:mainfrom
Open
fix: resolve NameError and import pathing in main.py#389lokesh12344 wants to merge 1 commit intofireform-core:mainfrom
lokesh12344 wants to merge 1 commit intofireform-core:mainfrom
Conversation
Author
|
Issue #388 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes two critical bugs in
src/main.pythat prevented the script from running successfully in a standard environment.Changes
NameError: Addedfrom typing import Union. TheUniontype hint was used on line 14 but was never imported, causing the script to crash immediately upon execution.from controller import Controllertofrom src.controller import Controller. This ensures the script can be run from the project root directory (standard practice) without triggering aModuleNotFoundError.How to Verify
Before this fix, running
python3 src/main.pyfrom the root would result in:NameError: name 'Union' is not definedModuleNotFoundError: No module named 'controller'After this fix, the script successfully imports all dependencies and initializes the
Controller.Fixes #388