@@ -51,7 +51,7 @@ public PyLong(PyObject o)
5151public PyLong ( int value )
5252{
5353obj = Runtime . PyLong_FromLong ( value ) ;
54- Runtime . CheckExceptionOccurred ( ) ;
54+ PythonException . ThrowIfIsNull ( obj ) ;
5555}
5656
5757
@@ -65,7 +65,7 @@ public PyLong(int value)
6565public PyLong ( uint value )
6666{
6767obj = Runtime . PyLong_FromLong ( value ) ;
68- Runtime . CheckExceptionOccurred ( ) ;
68+ PythonException . ThrowIfIsNull ( obj ) ;
6969}
7070
7171
@@ -78,7 +78,7 @@ public PyLong(uint value)
7878public PyLong ( long value )
7979{
8080obj = Runtime . PyLong_FromLongLong ( value ) ;
81- Runtime . CheckExceptionOccurred ( ) ;
81+ PythonException . ThrowIfIsNull ( obj ) ;
8282}
8383
8484
@@ -92,7 +92,7 @@ public PyLong(long value)
9292public PyLong ( ulong value )
9393{
9494obj = Runtime . PyLong_FromUnsignedLongLong ( value ) ;
95- Runtime . CheckExceptionOccurred ( ) ;
95+ PythonException . ThrowIfIsNull ( obj ) ;
9696}
9797
9898
@@ -105,7 +105,7 @@ public PyLong(ulong value)
105105public PyLong ( short value )
106106{
107107obj = Runtime . PyLong_FromLong ( value ) ;
108- Runtime . CheckExceptionOccurred ( ) ;
108+ PythonException . ThrowIfIsNull ( obj ) ;
109109}
110110
111111
@@ -119,7 +119,7 @@ public PyLong(short value)
119119public PyLong ( ushort value )
120120{
121121obj = Runtime . PyLong_FromLong ( value ) ;
122- Runtime . CheckExceptionOccurred ( ) ;
122+ PythonException . ThrowIfIsNull ( obj ) ;
123123}
124124
125125
@@ -132,7 +132,7 @@ public PyLong(ushort value)
132132public PyLong ( byte value )
133133{
134134obj = Runtime . PyLong_FromLong ( value ) ;
135- Runtime . CheckExceptionOccurred ( ) ;
135+ PythonException . ThrowIfIsNull ( obj ) ;
136136}
137137
138138
@@ -146,7 +146,7 @@ public PyLong(byte value)
146146public PyLong ( sbyte value )
147147{
148148obj = Runtime . PyLong_FromLong ( value ) ;
149- Runtime . CheckExceptionOccurred ( ) ;
149+ PythonException . ThrowIfIsNull ( obj ) ;
150150}
151151
152152
@@ -159,7 +159,7 @@ public PyLong(sbyte value)
159159public PyLong ( double value )
160160{
161161obj = Runtime . PyLong_FromDouble ( value ) ;
162- Runtime . CheckExceptionOccurred ( ) ;
162+ PythonException . ThrowIfIsNull ( obj ) ;
163163}
164164
165165
@@ -172,7 +172,7 @@ public PyLong(double value)
172172public PyLong ( string value )
173173{
174174obj = Runtime . PyLong_FromString ( value , IntPtr . Zero , 0 ) ;
175- Runtime . CheckExceptionOccurred ( ) ;
175+ PythonException . ThrowIfIsNull ( obj ) ;
176176}
177177
178178
@@ -199,7 +199,7 @@ public static bool IsLongType(PyObject value)
199199public static PyLong AsLong ( PyObject value )
200200{
201201IntPtr op = Runtime . PyNumber_Long ( value . obj ) ;
202- Runtime . CheckExceptionOccurred ( ) ;
202+ PythonException . ThrowIfIsNull ( op ) ;
203203return new PyLong ( op ) ;
204204}
205205