Skip to content

Commit

Permalink
Fix regression from 5.0.0 that causes TypeError when passing shell-sp…
Browse files Browse the repository at this point in the history
…ecific kwargs (#263)
  • Loading branch information
sloria authored Nov 21, 2024
1 parent c6db914 commit 63ea17f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
Changelog
*********

5.0.1 (unreleased)
------------------

Bug fixes:

* Fix bug that caused: ``TypeError: Shell.__init__() got an unexpected keyword argument``
when using ``konch.start()`` or ``konch.AutoShell`` with
shell-specific keyword arguments (:issue:`sloria/flask-konch#41`).

5.0.0 (2024-11-05)
------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

extensions = ["sphinx.ext.autodoc", "sphinx_issues"]

issues_github_path = "sloria/doitlive"
issues_github_path = "sloria/konch"

templates_path = ["_templates"]

Expand Down
3 changes: 3 additions & 0 deletions src/konch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ def __init__(
prompt: typing.Optional[str] = None,
output: typing.Optional[str] = None,
context_format: ContextFormat = "full",
# XXX: kwargs is unused but is needed for AutoShell to pass through kwargs
# to other subclasses.
**kwargs,
) -> None:
self.context = context() if callable(context) else context
self.context_format = context_format
Expand Down
6 changes: 6 additions & 0 deletions tests/test_konch.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,12 @@ def test_resolve_path(folderenv):
assert konch.resolve_path(".konchrc") == fpath


def test_autoshell_takes_all_kwargs():
assert konch.AutoShell(
context={"foo": 42}, banner="bar", ptpy_vi_mode=True, ipy_autoreload=True
)


class TestAuthFile:
@pytest.fixture()
def auth_file(self, env):
Expand Down

0 comments on commit 63ea17f

Please sign in to comment.