-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: NameError: name 'computer' is not defined #937
Fix: NameError: name 'computer' is not defined #937
Conversation
Traceback (most recent call last): |
Added a quick fix, just putting |
…/open-interpreter into fix-computer-not-defined
interpreter.computer.run( | ||
"python", | ||
"import time\nfrom interpreter import interpreter\ncomputer = interpreter.computer", # We ask it to use time, so | ||
for _ in interpreter.computer.run( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually why I added that part that pulls from the stream! It allows you to just run interpreter.computer.run
without the for _ in
syntax. I'll merge but will revert this.
@@ -630,7 +631,7 @@ def start_terminal_interface(interpreter): | |||
|
|||
# Set attributes on interpreter | |||
for argument_name, argument_value in vars(args).items(): | |||
if argument_value != None: | |||
if argument_value is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://peps.python.org/pep-0008/#programming-recommendations
"Comparisons to singletons like None should always be done with is or is not, never the equality operators."
Thanks @Arrendy! And thanks @Notnaton for working on this as well! This was totally a mistake I made, luckily committed after the last version that went out to Renaming it to |
Describe the changes you have made:
The
run
method in theTerminal
class is a generator function that executes some code and yields the results one at a time. In a previous commit, the for loop was removed that was used to iterate over these results, which caused therun
method to not actually be executed because its results were not being consumed. This commit adds the for loop back to ensure that therun
method is properly executed.Reference any relevant issues (e.g. "Fixes #000"):
#875
Pre-Submission Checklist (optional but appreciated):
docs/CONTRIBUTING.md
docs/ROADMAP.md
OS Tests (optional but appreciated):