File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ export interface PythonProxy {
6161export type PythonConvertible =
6262 | number
6363 | bigint
64+ | void
6465 | null
6566 | undefined
6667 | boolean
@@ -434,7 +435,7 @@ export class PyObject {
434435 }
435436
436437 case "object" : {
437- if ( v === null ) {
438+ if ( v === null /*or void*/ ) {
438439 return python . builtins . None [ ProxiedPyObject ] ;
439440 } else if ( ProxiedPyObject in v ) {
440441 const proxy = v as PythonProxy ;
Original file line number Diff line number Diff line change @@ -298,6 +298,21 @@ def call(cb):
298298 cb . destroy ( ) ;
299299} ) ;
300300
301+ Deno . test ( "callback returns void" , ( ) => {
302+ const { call } = python . runModule (
303+ `
304+ def call(cb):
305+ cb()
306+ ` ,
307+ "cb_test.py" ,
308+ ) ;
309+ const cb = python . callback ( ( ) => {
310+ // return void
311+ } ) ;
312+ call ( cb ) ;
313+ cb . destroy ( ) ;
314+ } ) ;
315+
301316Deno . test ( "exceptions" , async ( t ) => {
302317 await t . step ( "simple exception" , ( ) => {
303318 assertThrows ( ( ) => python . runModule ( "1 / 0" ) ) ;
You can’t perform that action at this time.
0 commit comments