File tree 1 file changed +14
-2
lines changed 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -60,10 +60,22 @@ def _define_operators(cls):
60
60
def _wrap (cls , op , inplace = False , unary = False ):
61
61
62
62
def fn_unary_op (self ):
63
- return self ._op (op )
63
+ try :
64
+ return self ._op (op )
65
+ except SystemError as e :
66
+ message = ("Numpy returned an uninformative error. It possibly should be "
67
+ "'Integers to negative integer powers are not allowed.' "
68
+ "See https://github.com/numpy/numpy/issues/19634 for details." )
69
+ raise ValueError (message ) from e
64
70
65
71
def fn_binary_op (self , value ):
66
- return self ._op (op , value , inplace = inplace )
72
+ try :
73
+ return self ._op (op , value , inplace = inplace )
74
+ except SystemError as e :
75
+ message = ("Numpy returned an uninformative error. It possibly should be "
76
+ "'Integers to negative integer powers are not allowed.' "
77
+ "See https://github.com/numpy/numpy/issues/19634 for details." )
78
+ raise ValueError (message ) from e
67
79
68
80
setattr (cls , op , fn_unary_op if unary else fn_binary_op )
69
81
fn = getattr (cls , op )
You can’t perform that action at this time.
0 commit comments