Skip to content

Commit

Permalink
host: Fix gf shell not being able to access globals inside user defin…
Browse files Browse the repository at this point in the history
…ed functions
  • Loading branch information
antoinevg committed Aug 7, 2024
1 parent 1fc2e52 commit 0190c99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions host/greatfet/commands/greatfet_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,15 @@ def main():
singleton_text = "singleton " if args.singleton else ""
print("A GreatFET {}object has been created for you as 'gf'. Have fun!\n".format(singleton_text))

# Mute annoying venv warning.
config = IPython.terminal.ipapp.load_default_config()
config.InteractiveShell.warn_venv = False

# Create a new shell, and give it access to our created GreatFET object.
if IPython.core.getipython.get_ipython() is None:
shell = IPython.terminal.embed.InteractiveShellEmbed.instance()
shell = IPython.terminal.interactiveshell.TerminalInteractiveShell.instance(config=config)
else:
shell = IPython.terminal.embed.InteractiveShellEmbed()
shell = IPython.terminal.interactiveshell.TerminalInteractiveShell(config=config)
shell.push('gf')

# Create nice aliases for our primary interfaces.
Expand Down
4 changes: 2 additions & 2 deletions host/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ dependencies = [
"future",
"pyfwup>=0.2",
"tqdm",
"setuptools", # cmsis_svd requires pkg_resources
"setuptools", # cmsis_svd requires pkg_resources
"cmsis_svd",
"tabulate",
"prompt_toolkit",
"pygreat",
"ipython~=8.25",
"ipython~=8.12", # final version supported by Python 3.8
]

dynamic = ["version"]
Expand Down

0 comments on commit 0190c99

Please sign in to comment.