J'ai IronPython incorporé dans une application C#. Je laisse les utilisateurs écrire des scripts IronPython, dans lesquels ils peuvent importer un ensemble de bibliothèques standard livrées avec IronPython. Dans ces scripts, lorsqu'un utilisateur importe la bibliothèque "random" ou la bibliothèque "filecmp", une exception GeneratorExitException non gérée est générée.Unhandled GeneratorExitException levée lors de l'importation de la bibliothèque dans IronPython incorporé
D'autres bibliothèques comme math, re, string et os sont importables par les utilisateurs sans aucun problème.
Ceci est la trace de la pile que je reçois:
IronPython.dll!IronPython.Runtime.PythonGenerator.ThrowThrowable() + 0x85 bytes
IronPython.dll!IronPython.Runtime.PythonGenerator.CheckThrowable() + 0x27 bytes
IronPython.dll!IronPython.Runtime.PythonGenerator.CheckThrowableAndReturnSendValue() + 0x3c bytes
IronPython.dll!IronPython.Runtime.Operations.PythonOps.GeneratorCheckThrowableAndReturnSendValue(object self = {IronPython.Runtime.PythonGenerator}) + 0x49 bytes
Snippets.debug.scripting!S$12.lambda_method$344(ref int state = -1, ref object current = null) + 0x124 bytes Unknown
Microsoft.Scripting.dll!Microsoft.Scripting.Runtime.GeneratorEnumerator<object>.System.Collections.IEnumerator.MoveNext() + 0x3c bytes
IronPython.dll!IronPython.Runtime.PythonGenerator.MoveNextWorker() + 0xa3 bytes
IronPython.dll!IronPython.Runtime.PythonGenerator.System.Collections.IEnumerator.MoveNext() + 0x42 bytes
IronPython.dll!IronPython.Runtime.PythonGenerator.throw(object type = {"Exception of type 'IronPython.Runtime.Exceptions.GeneratorExitException' was thrown."}, object value = null, object traceback = null) + 0xb5 bytes
IronPython.dll!IronPython.Runtime.PythonGenerator.throw(object type = {"Exception of type 'IronPython.Runtime.Exceptions.GeneratorExitException' was thrown."}) + 0x2a bytes
IronPython.dll!IronPython.Runtime.PythonGenerator.close() + 0x56 bytes
IronPython.dll!IronPython.Runtime.PythonGenerator.Finalize() + 0x42 bytes
Quelqu'un at-il fait face à un problème similaire? Et quelle est la solution?
EDIT Cela se produit uniquement lorsque le débogueur Visual Studio est connecté.
Oui, cela se produit uniquement lorsque le débogueur Visual Studio est connecté. – Rohit
Ok, dans ce cas, il devrait être quelque chose que vous pouvez ignorer en toute sécurité et, espérons-le, ça va disparaître en 2.6. Pour améliorer votre expérience de débogage, vous pouvez configurer VS pour ne pas interrompre GeneratorExitExceptions dans la boîte de dialogue d'exception. –