public static void PerformModuleReload(PythonContext/*!*/ context, PythonDictionary/*!*/ dict) { context.EnsureModuleException("PickleError", dict, "PickleError", "cPickle"); context.EnsureModuleException("PicklingError", dict, "PicklingError", "cPickle"); context.EnsureModuleException("UnpicklingError", dict, "UnpicklingError", "cPickle"); context.EnsureModuleException("UnpickleableError", dict, "UnpickleableError", "cPickle"); context.EnsureModuleException("BadPickleGet", dict, "BadPickleGet", "cPickle"); dict["__builtins__"] = context.BuiltinModuleInstance; dict["compatible_formats"] = PythonOps.MakeList("1.0", "1.1", "1.2", "1.3", "2.0"); }
public static void PerformModuleReload(PythonContext/*!*/ context, IAttributesCollection/*!*/ dict) { context.EnsureModuleException("PickleError", dict, "PickleError", "cPickle"); context.EnsureModuleException("PicklingError", dict, "PicklingError", "cPickle"); context.EnsureModuleException("UnpicklingError", dict, "UnpicklingError", "cPickle"); context.EnsureModuleException("UnpickleableError", dict, "UnpickleableError", "cPickle"); context.EnsureModuleException("BadPickleGet", dict, "BadPickleGet", "cPickle"); dict[Symbols.Builtins] = context.BuiltinModuleInstance; dict[SymbolTable.StringToId("compatible_formats")] = PythonOps.MakeList("1.0", "1.1", "1.2", "1.3", "2.0"); }
public static void PerformModuleReload(PythonContext/*!*/ context, PythonDictionary/*!*/ dict) { if (!context.HasModuleState(_defaultTimeoutKey)) { context.SetModuleState(_defaultTimeoutKey, null); } context.SetModuleState(_defaultBufsizeKey, DefaultBufferSize); PythonType socketErr = GetSocketError(context, dict); context.EnsureModuleException("socketherror", socketErr, dict, "herror", "socket"); context.EnsureModuleException("socketgaierror", socketErr, dict, "gaierror", "socket"); context.EnsureModuleException("sockettimeout", socketErr, dict, "timeout", "socket"); }
public static void PerformModuleReload(PythonContext/*!*/ context, IAttributesCollection/*!*/ dict) { if (!context.HasModuleState(_defaultTimeoutKey)) { context.SetModuleState(_defaultTimeoutKey, null); } context.SetModuleState(_defaultBufsizeKey, DefaultBufferSize); context.EnsureModuleException("sslerror", dict, "sslerror", "socket"); PythonType socketErr = context.EnsureModuleException("socketerror", PythonExceptions.IOError, dict, "error", "socket"); context.EnsureModuleException("socketherror", socketErr, dict, "herror", "socket"); context.EnsureModuleException("socketgaierror", socketErr, dict, "gaierror", "socket"); context.EnsureModuleException("sockettimeout", socketErr, dict, "timeout", "socket"); }
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"); }
private static void InitModuleExceptions(PythonContext context, PythonDictionary dict) { context.EnsureModuleException( "zipimport.ZipImportError", PythonExceptions.ImportError, typeof(PythonExceptions._ImportError), dict, "ZipImportError", "zipimport", (msg, innerException) => new ImportException(msg, innerException)); }
private static void InitModuleExceptions(PythonContext context, PythonDictionary dict) { ZipImportError = context.EnsureModuleException( "zipimport.ZipImportError", PythonExceptions.ImportError, typeof(PythonExceptions.BaseException), dict, "ZipImportError", "zipimport", msg => new ImportException(msg)); }
public static void PerformModuleReload(PythonContext/*!*/ context, IAttributesCollection/*!*/ dict) { context.EnsureModuleException("ArgumentError", dict, "ArgumentError", "_ctypes"); context.EnsureModuleException("COMError", dict, "COMError", "_ctypes"); // TODO: Provide an implementation which is coordinated with our _refCountTable context.SystemState.__dict__["getrefcount"] = null; PythonDictionary pointerTypeCache = new PythonDictionary(); dict[SymbolTable.StringToId("_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.SetModuleState(_conversion_mode, PythonTuple.MakeTuple("mbcs", "ignore")); } else { context.SetModuleState(_conversion_mode, PythonTuple.MakeTuple("ascii", "strict")); } }
public static void PerformModuleReload(PythonContext/*!*/ context, PythonDictionary/*!*/ dict) { context.SetModuleState(_stackSizeKey, 0); context.EnsureModuleException("threaderror", dict, "error", "thread"); }
internal static PythonType GetSocketError(PythonContext context, PythonDictionary dict) { return context.EnsureModuleException("socketerror", PythonExceptions.IOError, dict, "error", "socket"); }
private static void InitModuleExceptions(PythonContext context, PythonDictionary dict) { Error = context.EnsureModuleException("csv.Error", PythonExceptions.StandardError, dict, "Error", "_csv"); }
/// <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) { error = context.EnsureModuleException("zlib.error", PythonExceptions.Exception, dict, "error", "zlib"); }
public static void PerformModuleReload(PythonContext/*!*/ context, PythonDictionary/*!*/ dict) { context.EnsureModuleException("selecterror", dict, "error", "select"); }
public static void PerformModuleReload(PythonContext/*!*/ context, IAttributesCollection/*!*/ dict) { context.EnsureModuleException(_ErrorKey, dict, "Error", "binascii"); context.EnsureModuleException(_IncompleteKey, dict, "Incomplete", "binascii"); }
public static void PerformModuleReload(PythonContext/*!*/ context, IAttributesCollection/*!*/ dict) { context.EnsureModuleException("binasciierror", dict, "Error", "binascii"); }
public static void PerformModuleReload(PythonContext/*!*/ context, PythonDictionary/*!*/ dict) { context.EnsureModuleException(_mmapErrorKey, PythonExceptions.EnvironmentError, dict, "error", "mmap"); }
public static void PerformModuleReload(PythonContext/*!*/ context, IAttributesCollection/*!*/ dict) { EnsureLocaleInitialized(context); context.EnsureModuleException("_localeerror", dict, "Error", "_locale"); }
public static void PerformModuleReload(PythonContext/*!*/ context, IAttributesCollection/*!*/ dict) { context.EnsureModuleException("PickleError", dict, "PickleError", "cPickle"); context.EnsureModuleException("PicklingError", dict, "PicklingError", "cPickle"); context.EnsureModuleException("UnpicklingError", dict, "UnpicklingError", "cPickle"); context.EnsureModuleException("BadPickleGet", dict, "BadPickleGet", "cPickle"); }