File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,7 @@ export class PyObject {
194
194
*/
195
195
get isNone ( ) {
196
196
return this . handle === 0 ||
197
+ this . handle === 0n ||
197
198
this . handle === python . None [ ProxiedPyObject ] . handle ;
198
199
}
199
200
Original file line number Diff line number Diff line change 1
- import { assert , assertEquals } from "./deps.ts" ;
1
+ import { assert , assertEquals , assertThrows } from "./deps.ts" ;
2
2
import {
3
3
kw ,
4
4
NamedArgument ,
@@ -294,3 +294,15 @@ def call(cb):
294
294
8BFD
td> ) ;
295
295
cb . destroy ( ) ;
296
296
} ) ;
297
+
298
+ Deno . test ( "exceptions" , async ( t ) => {
299
+ await t . step ( "simple exception" , ( ) => {
300
+ assertThrows ( ( ) => python . runModule ( "1 / 0" ) ) ;
301
+ } ) ;
302
+
303
+ await t . step ( "exception with traceback" , ( ) => {
304
+ const np = python . import ( "numpy" ) ;
305
+ const array = np . zeros ( [ 2 , 3 , 4 ] ) ;
306
+ assertThrows ( ( ) => array . shape = [ 3 , 6 ] ) ;
307
+ } ) ;
308
+ } ) ;
You can’t perform that action at this time.
0 commit comments