Skip to content

Commit c845e5e

Browse files
committed
more info in message
1 parent 2e45aa5 commit c845e5e

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

ipykernel/kernelbase.py

+20-8
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
" either be a coroutine function (`async def`) or return an awaitable object"
6363
" (like an `asyncio.Future`). It might become a requirement in the future."
6464
" Coroutine functions and awaitables have been supported since"
65-
" ipykernel 6.0 (2021)."
65+
" ipykernel 6.0 (2021). {target} does not seem to return an awaitable"
6666
)
6767

6868

@@ -752,7 +752,9 @@ async def execute_request(self, socket, ident, parent):
752752
reply_content = await reply_content
753753
else:
754754
warnings.warn(
755-
_AWAITABLE_MESSAGE.format(func_name="execute_request"),
755+
_AWAITABLE_MESSAGE.format(
756+
func_name="do_execute", target=self.do_execute
757+
),
756758
PendingDeprecationWarning,
757759
stacklevel=1,
758760
)
@@ -818,7 +820,9 @@ async def complete_request(self, socket, ident, parent):
818820
matches = await matches
819821
else:
820822
warnings.warn(
821-
_AWAITABLE_MESSAGE.format(func_name="do_complete"),
823+
_AWAITABLE_MESSAGE.format(
824+
func_name="do_complete", target=self.do_complete
825+
),
822826
PendingDeprecationWarning,
823827
stacklevel=1,
824828
)
@@ -852,7 +856,9 @@ async def inspect_request(self, socket, ident, parent):
852856
reply_content = await reply_content
853857
else:
854858
warnings.warn(
855-
_AWAITABLE_MESSAGE.format(func_name="do_inspect"),
859+
_AWAITABLE_MESSAGE.format(
860+
func_name="do_inspect", target=self.do_inspect
861+
),
856862
PendingDeprecationWarning,
857863
stacklevel=1,
858864
)
@@ -877,7 +883,9 @@ async def history_request(self, socket, ident, parent):
877883
reply_content = await reply_content
878884
else:
879885
warnings.warn(
880-
_AWAITABLE_MESSAGE.format(func_name="do_history"),
886+
_AWAITABLE_MESSAGE.format(
887+
func_name="do_history", target=self.do_history
888+
),
881889
PendingDeprecationWarning,
882890
stacklevel=1,
883891
)
@@ -1000,7 +1008,9 @@ async def shutdown_request(self, socket, ident, parent):
10001008
content = await content
10011009
else:
10021010
warnings.warn(
1003-
_AWAITABLE_MESSAGE.format(func_name="do_shutdown"),
1011+
_AWAITABLE_MESSAGE.format(
1012+
func_name="do_shutdown", target=self.do_shutdown
1013+
),
10041014
PendingDeprecationWarning,
10051015
stacklevel=1,
10061016
)
@@ -1030,7 +1040,9 @@ async def is_complete_request(self, socket, ident, parent):
10301040
reply_content = await reply_content
10311041
else:
10321042
warnings.warn(
1033-
_AWAITABLE_MESSAGE.format(func_name="do_is_complete"),
1043+
_AWAITABLE_MESSAGE.format(
1044+
func_name="do_is_complete", target=self.do_is_complete
1045+
),
10341046
PendingDeprecationWarning,
10351047
stacklevel=1,
10361048
)
@@ -1052,7 +1064,7 @@ async def debug_request(self, socket, ident, parent):
10521064
reply_content = await reply_content
10531065
else:
10541066
warnings.warn(
1055-
_AWAITABLE_MESSAGE.format(func_name="do_debug_request"),
1067+
_AWAITABLE_MESSAGE.format(func_name="do_debug_request", self.do_debug_request),
10561068
PendingDeprecationWarning,
10571069
stacklevel=1,
10581070
)

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ filterwarnings= [
192192
"ignore:unclosed database in <sqlite3.Connection:ResourceWarning",
193193

194194
# ignore deprecated non async during tests:
195-
"ignore:For consistency across implementations, it is recommended that:PendingDeprecationWarning",
195+
"always:For consistency across implementations, it is recommended that:PendingDeprecationWarning",
196196

197197
]
198198

0 commit comments

Comments
 (0)