Skip to content
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

applet: fix repl format conversion #214

Merged
merged 1 commit into from
Oct 24, 2020

Conversation

attie
Copy link
Member

@attie attie commented Oct 10, 2020

While working on #213, I noticed the following error:

venv:$ glasgow run --help
Traceback (most recent call last):
  File "/home/attie/proj_local/glasgow/venv/bin/glasgow", line 11, in <module>
    load_entry_point('glasgow', 'console_scripts', 'glasgow')()
  File "/home/attie/proj_local/glasgow/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/attie/proj_local/glasgow/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/home/attie/proj_local/glasgow/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/home/attie/proj_local/glasgow/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/attie/proj_local/glasgow/glasgow/software/glasgow/cli.py", line 29, in <module>
    from .applet import all, external
  File "/home/attie/proj_local/glasgow/glasgow/software/glasgow/applet/external.py", line 6, in <module>
    entry_point.load()
  File "/home/attie/proj_local/glasgow/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/home/attie/proj_local/glasgow/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/attie/proj_local/glasgow/glasgow/examples/out-of-tree-applet/glasgow_oot/__init__.py", line 1, in <module>
    from .uart import CustomUARTApplet
  File "/home/attie/proj_local/glasgow/glasgow/examples/out-of-tree-applet/glasgow_oot/uart.py", line 4, in <module>
    class CustomUARTApplet(UARTApplet, name="uart"):
  File "/home/attie/proj_local/glasgow/glasgow/software/glasgow/applet/__init__.py", line 21, in __new__
    raise NameError(f"Applet {name:r} already exists")
ValueError: Unknown format code 'r' for object of type 'str'

I suspect that {name!r} was intended instead of {name:r}?

@whitequark whitequark merged commit 7c4cb21 into GlasgowEmbedded:master Oct 24, 2020
@whitequark
Copy link
Member

Thanks!

@attie attie deleted the str-format branch October 24, 2020 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants