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

doc raise exceptions with a base class #18152

Merged
merged 2 commits into from Oct 6, 2017

Conversation

Projects
None yet
3 participants
@alfredodeza
Copy link
Contributor

commented Oct 6, 2017

Although valid in very old Python, it is no longer possible to raise
"bare" exceptions without a class.

Fixes the following build errors:

+ ./admin/build-doc
Traceback (most recent call last):
  File "/home/jenkins-build/build/workspace/ceph-pr-docs/doc/scripts/gen_state_diagram.py", line 207, in <module>
    RENDERER.read_input(INPUT_GENERATOR)
  File "/home/jenkins-build/build/workspace/ceph-pr-docs/doc/scripts/gen_state_diagram.py", line 89, in read_input
    self.get_event(line)
  File "/home/jenkins-build/build/workspace/ceph-pr-docs/doc/scripts/gen_state_diagram.py", line 141, in get_event
    raise "no context at line: " + line
TypeError: exceptions must be old-style classes or derived from BaseException, not str
doc raise exceptions with a base class
Although valid in very old Python, it is no longer possible to raise
"bare" exceptions without a class.

Signed-off-by: Alfredo Deza <adeza@redhat.com>
@theanalyst
Copy link
Member

left a comment

good for merge once the doc build passes

@theanalyst

This comment has been minimized.

Copy link
Member

commented Oct 6, 2017

now the exception is raised properly and the program fails gracefully, but we need to find out what caused that..

@theanalyst

This comment has been minimized.

Copy link
Member

commented Oct 6, 2017

seems to have been introduced in #18070, not sure whether the state diagrams need to be a part of docs build, are these a part of hte doc output?

@@ -107,7 +107,7 @@ def get_state(self, line):
r"boost::statechart::state_machine<\s*(\w*),\s*(\w*)\s*>",

This comment has been minimized.

Copy link
@theanalyst

theanalyst Oct 6, 2017

Member

changing L93 to match = re.search(r"(\w+::)*::(?P<tag>\w+)::\w+\(\s*const (?P<event>\w+)", makes the script pass locally for me

doc parse two lines for getting the context
So that signatures can get parsed when they are split like:

PG::RecoveryState::RepWaitBackfillReserved::react(
  const RemoteReservationCanceled &evt)

Signed-off-by: Alfredo Deza <adeza@redhat.com>

@alfredodeza alfredodeza force-pushed the wip-fix-doc-exceptions branch from e5595f7 to 9e2a52c Oct 6, 2017

@theanalyst theanalyst merged commit d71a42c into master Oct 6, 2017

5 checks passed

Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
make check (arm64) make check succeeded
Details

@alfredodeza alfredodeza deleted the wip-fix-doc-exceptions branch Oct 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.