Bug #55716
Updated by Rishabh Dave almost 2 years ago
cmd2.exceptions.Cmd2ArgparseError is imported without version check. It's available only after @1.0.0@
Following grep query was run cmd2 repo root -
<pre>
$ git checkout 1.0.1
Previous HEAD position was a7511e16 Added 1.1 release date to CHANGELOG
HEAD is now at 36864f4d Updating change log for release
$ grep -rnI Cmd2ArgparseError ./
./tests/test_plugin.py:852: Verify Cmd2ArgparseErrors raised after calling a command prevent postcmd events from
./cmd2/cmd2.py:53:from .exceptions import Cmd2ArgparseError, Cmd2ShlexError, EmbeddedConsoleExit, EmptyStatement
./cmd2/cmd2.py:1685: except (Cmd2ArgparseError, EmptyStatement):
./cmd2/exceptions.py:5:class Cmd2ArgparseError(Exception):
./cmd2/decorators.py:7:from .exceptions import Cmd2ArgparseError
./cmd2/decorators.py:148: raise Cmd2ArgparseError
./cmd2/decorators.py:220: raise Cmd2ArgparseError
$ git checkout 1.0.0
Previous HEAD position was 36864f4d Updating change log for release
HEAD is now at 59739aa5 Added info to changelog in preparation for 1.0.0 release
$ grep -rnI Cmd2ArgparseError ./
</pre>
SystemExit(2) is raised in earlier versions.
<pre>
$ pip install cmd2===0.8.5 && cephfs-shell -- get dump5
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Defaulting to user installation because normal site-packages is not writeable
Collecting cmd2===0.8.5
Using cached cmd2-0.8.5-py2.py3-none-any.whl (51 kB)
Requirement already satisfied: pyperclip in /home/rishabh/.local/lib/python3.9/site-packages (from cmd2===0.8.5) (1.8.2)
Requirement already satisfied: pyparsing>=2.0.1 in /usr/lib/python3.9/site-packages (from cmd2===0.8.5) (2.4.7)
Requirement already satisfied: wcwidth in /usr/lib/python3.9/site-packages (from cmd2===0.8.5) (0.2.5)
Requirement already satisfied: six in /usr/lib/python3.9/site-packages (from cmd2===0.8.5) (1.15.0)
Installing collected packages: cmd2
Attempting uninstall: cmd2
Found existing installation: cmd2 1.5.0
Uninstalling cmd2-1.5.0:
Successfully uninstalled cmd2-1.5.0
Successfully installed cmd2-0.8.5
WARNING: You are using pip version 22.0.4; however, version 22.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
usage: get [-h] [-f] remote_path local_path
get: error: the following arguments are required: local_path
$ echo $?
2
$
</pre>