public static void PerformModuleReload(PythonContext /*!*/ context, PythonDictionary /*!*/ dict) { context.EnsureModuleException("ArgumentError", dict, "ArgumentError", "_ctypes"); // TODO: Provide an implementation which is coordinated with our _refCountTable // context.SystemState.__dict__["getrefcount"] = null; PythonDictionary pointerTypeCache = new PythonDictionary(); dict["_pointer_type_cache"] = pointerTypeCache; context.SetModuleState(_pointerTypeCacheKey, pointerTypeCache); if (Environment.OSVersion.Platform == PlatformID.Win32NT || Environment.OSVersion.Platform == PlatformID.Win32S || Environment.OSVersion.Platform == PlatformID.Win32Windows || Environment.OSVersion.Platform == PlatformID.WinCE) { context.EnsureModuleException( "COMError", PythonExceptions.Exception, typeof(_COMError), dict, "COMError", "_ctypes", "Raised when a COM method call failed.", (msg, _) => new COMException(msg) ); context.SetModuleState(_conversion_mode, PythonTuple.MakeTuple("mbcs", "ignore")); } else { context.SetModuleState(_conversion_mode, PythonTuple.MakeTuple("ascii", "strict")); } }
private static void InitModuleExceptions(PythonContext context, PythonDictionary dict) { Warning = context.EnsureModuleException("sqlite.Warning", PythonExceptions.StandardError, dict, "Warning", "_sqlite3"); Error = context.EnsureModuleException("sqlite.Error", PythonExceptions.StandardError, dict, "Error", "_sqlite3"); InterfaceError = context.EnsureModuleException("sqlite.InterfaceError", Error, dict, "InterfaceError", "_sqlite3"); DatabaseError = context.EnsureModuleException("sqlite.DatabaseError", Error, dict, "DatabaseError", "_sqlite3"); DataError = context.EnsureModuleException("sqlite.DataError", DatabaseError, dict, "DataError", "_sqlite3"); OperationalError = context.EnsureModuleException("sqlite.OperationalError", DatabaseError, dict, "OperationalError", "_sqlite3"); IntegrityError = context.EnsureModuleException("sqlite.IntegrityError", DatabaseError, dict, "IntegrityError", "_sqlite3"); InternalError = context.EnsureModuleException("sqlite.InternalError", DatabaseError, dict, "InternalError", "_sqlite3"); ProgrammingError = context.EnsureModuleException("sqlite.ProgrammingError", DatabaseError, dict, "ProgrammingError", "_sqlite3"); NotSupportedError = context.EnsureModuleException("sqlite.NotSupportedError", DatabaseError, dict, "NotSupportedError", "_sqlite3"); }
public static void PerformModuleReload(PythonContext /*!*/ context, PythonDictionary /*!*/ dict) { var socket = context.GetBuiltinModule("socket"); var socketError = PythonSocket.GetSocketError(context, socket.__dict__); context.EnsureModuleException("SSLError", socketError, dict, "SSLError", "ssl"); }
/// <summary> /// Initialize exception /// </summary> /// <param name="context"></param> /// <param name="dict"></param> private static void InitModuleExceptions(PythonContext context, PythonDictionary dict) { GenericImporterError = context.EnsureModuleException( "genericimporter.GenericImporterError", PythonExceptions.ImportError, typeof(PythonExceptions.BaseException), dict, "GenericImporterError", "genericimporter", msg => new ImportException(msg)); }
public static void PerformModuleReload(PythonContext /*!*/ context, PythonDictionary /*!*/ dict) { var exception = context.EnsureModuleException("pyexpaterror", dict, "ExpatError", "xml.parsers.expat"); dict["error"] = exception; dict["ExpatError"] = exception; context.GetOrCreateModuleState(_errorsKey, () => { dict.Add("errors", new PyExpatErrors()); return(dict); }); }
public static void PerformModuleReload(PythonContext /*!*/ context, PythonDictionary /*!*/ dict) { var sslError = context.EnsureModuleException("SSLError", PythonSocket.error, dict, "SSLError", "ssl"); context.EnsureModuleException("SSLZeroReturnError", sslError, dict, "SSLZeroReturnError", "ssl"); context.EnsureModuleException("SSLWantWriteError", sslError, dict, "SSLWantWriteError", "ssl"); context.EnsureModuleException("SSLSyscallError", sslError, dict, "SSLSyscallError", "ssl"); context.EnsureModuleException("SSLEOFError", sslError, dict, "SSLEOFError", "ssl"); context.EnsureModuleException("SSLWantReadError", sslError, dict, "SSLWantReadError", "ssl"); }
public static void PerformModuleReload(PythonContext/*!*/ context, PythonDictionary/*!*/ dict) { var socket = context.GetBuiltinModule("_socket"); var socketError = PythonSocket.GetSocketError(context, socket.__dict__); var sslError = context.EnsureModuleException("SSLError", socketError, dict, "SSLError", "ssl"); context.EnsureModuleException("SSLZeroReturnError", sslError, dict, "SSLZeroReturnError", "ssl"); context.EnsureModuleException("SSLWantWriteError", sslError, dict, "SSLWantWriteError", "ssl"); context.EnsureModuleException("SSLSyscallError", sslError, dict, "SSLSyscallError", "ssl"); context.EnsureModuleException("SSLEOFError", sslError, dict, "SSLEOFError", "ssl"); context.EnsureModuleException("SSLWantReadError", sslError, dict, "SSLWantReadError", "ssl"); }
public static void PerformModuleReload(PythonContext /*!*/ context, PythonDictionary /*!*/ dict) { context.SetModuleState(_stackSizeKey, 0); context.EnsureModuleException("threaderror", dict, "error", "thread"); }
private static void InitModuleExceptions(PythonContext context, PythonDictionary dict) { Error = context.EnsureModuleException("csv.Error", PythonExceptions.StandardError, dict, "Error", "_csv"); }
public static void PerformModuleReload(PythonContext /*!*/ context, PythonDictionary /*!*/ dict) { context.EnsureModuleException("audiooperror", dict, "error", "audioop"); }
public static void PerformModuleReload(PythonContext /*!*/ context, PythonDictionary /*!*/ dict) { context.EnsureModuleException(_ErrorKey, dict, "Error", "binascii"); context.EnsureModuleException(_IncompleteKey, dict, "Incomplete", "binascii"); }
public static void PerformModuleReload(PythonContext /*!*/ context, PythonDictionary /*!*/ dict) { context.EnsureModuleException(_mmapErrorKey, PythonExceptions.OSError, dict, "error", "mmap"); }
public static void PerformModuleReload(PythonContext /*!*/ context, PythonDictionary /*!*/ dict) { EnsureLocaleInitialized(context); context.EnsureModuleException("_localeerror", dict, "Error", "_locale"); }
public static void PerformModuleReload(PythonContext context, PythonDictionary dict) { error = context.EnsureModuleException("zlib.error", PythonExceptions.Exception, dict, "error", "zlib"); }