Skip to content

Commit ac3faeb

Browse files
authored
AssertionErrors should not be manually raised. (#411)
* Remove option from extension that is not present anymore. This was used by sphinxcontrib_github_alt, that is not in the list of extensions. * AssertionErrors should not be manually raised. assert are meant to be always true – but should be disabled when running with Python optimisations. That is to say an optimised run should not raise an assertion error. This is misusing assertions.
1 parent 28131c1 commit ac3faeb

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

docs/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@
4545
except ModuleNotFoundError:
4646
pass
4747

48-
github_project_url = "https://github.com/jupyter/jupyter_core"
49-
5048
# Add any paths that contain templates here, relative to this directory.
5149
templates_path = ["_templates"]
5250

jupyter_core/utils/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ def run_sync(coro: Callable[..., Awaitable[T]]) -> Callable[..., T]:
144144
Whatever the coroutine-function returns.
145145
"""
146146

147-
if not inspect.iscoroutinefunction(coro):
148-
raise AssertionError
147+
assert inspect.iscoroutinefunction(coro)
149148

150149
def wrapped(*args: Any, **kwargs: Any) -> Any:
151150
name = threading.current_thread().name

0 commit comments

Comments
 (0)