diff --git a/cherry_picker/cherry_picker.py b/cherry_picker/cherry_picker.py index 3e59f39..aeaa0f1 100755 --- a/cherry_picker/cherry_picker.py +++ b/cherry_picker/cherry_picker.py @@ -803,8 +803,8 @@ def cherry_pick_cli( config=config, chosen_config_path=chosen_config_path, ) - except InvalidRepoException: - click.echo(f"You're not inside a {config['repo']} repo right now! \U0001F645") + except InvalidRepoException as ire: + click.echo(ire.args[0]) sys.exit(-1) except ValueError as exc: ctx.fail(exc) diff --git a/cherry_picker/test_cherry_picker.py b/cherry_picker/test_cherry_picker.py index 3a9f670..b5b1b77 100644 --- a/cherry_picker/test_cherry_picker.py +++ b/cherry_picker/test_cherry_picker.py @@ -406,7 +406,11 @@ def test_is_cpython_repo(subprocess_check_output): def test_is_not_cpython_repo(): # use default CPython sha to fail on this repo - with pytest.raises(InvalidRepoException): + with pytest.raises( + InvalidRepoException, + match=r"The sha listed in the branch name, " + r"\w+, is not present in the repository", + ): CherryPicker("origin", "22a594a0047d7706537ff2ac676cdc0f1dcb329c", ["3.6"])