Exemple #1
0
 /// <summary>
 /// Exposed as the __init__ for Exception() inside the interpreter. The self parameter
 /// is exposed in order to invoke the constructor using the class Python class method
 /// signature where the 'this' pointer is the first argument. It is just a handle to
 /// the current object.
 /// </summary>
 /// <param name="self">The exception reference created from __init__. Included for API consistency to Python
 /// but otherwise not useful in C# since we impliciy have the this pointer.</param>
 /// <param name="message">The exception message</param>
 public void PythonPyExceptionConstructor(PyException self, string message)
 {
     Message = message;
     tb      = null;
 }
Exemple #2
0
 /// <summary>
 /// Embedded implementation of a Python Exception constructor.
 /// </summary>
 /// <param name="self">The PyObject to use as an exception created via __new__</param>
 /// <param name="message">The Exception message</param>
 /// <returns>The same object, properly populated. This is the convention for constructors,
 /// although the interpreter just assumes the object it passed in is the returned value anyways.
 /// </returns>
 private PyObject __init__impl(PyException self, string message)
 {
     self.PythonPyExceptionConstructor(self, message);
     return(self);
 }
Exemple #3
0
 private PyObject __init__impl(PyException self, PyString message)
 {
     return(__init__impl(self, message.str));
 }
Exemple #4
0
 private PyObject __init__impl(PyException self, PyString message)
 {
     return(__init__impl(self, message.InternalValue));
 }