Skip to content

Commit f9dc3ad

Browse files
committed
Fix skills import
1 parent 9735945 commit f9dc3ad

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

interpreter/core/computer/computer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __init__(self, interpreter):
4949
self.import_computer_api = False # Defaults to false
5050
self._has_imported_computer_api = False # Because we only want to do this once
5151

52-
self.should_import_skills = False
52+
self.import_skills = False
5353
self._has_imported_skills = False
5454

5555
# Shortcut for computer.terminal.languages

interpreter/core/computer/terminal/terminal.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,8 @@ def get_language(self, language):
3737
return None
3838

3939
def run(self, language, code, stream=False, display=False):
40-
if (
41-
language == "python"
42-
and self.computer.import_computer_api
43-
and "computer" in code
44-
):
45-
if not self.computer._has_imported_computer_api:
40+
if language == "python":
41+
if self.computer.import_computer_api and not self.computer._has_imported_computer_api and "computer" in code:
4642
self.computer._has_imported_computer_api = True
4743
# Give it access to the computer via Python
4844
self.computer.run(
@@ -51,12 +47,9 @@ def run(self, language, code, stream=False, display=False):
5147
display=self.computer.verbose,
5248
)
5349

54-
if not self.computer._has_imported_skills:
50+
if self.computer.import_skills and not self.computer._has_imported_skills:
5551
self.computer._has_imported_skills = True
56-
if self.computer.should_import_skills:
57-
if self.verbose:
58-
print("Importing skills")
59-
self.computer.skills.import_skills()
52+
self.computer.skills.import_skills()
6053

6154
if stream == False:
6255
# If stream == False, *pull* from _streaming_run.

0 commit comments

Comments
 (0)