Skip to content

Recursion limiter

Frederic Zinelli a demandé de fusionner recursion-limiter vers main

Closes #50 (closed)

ADD - New REC_LIMIT argument for the IDE macros, to change the recursion depth.

  • This is done through sys.setrecursionlimit, and this function is automatically forbidden at runtime.

  • This also means the python private tests "cannot" change its value at runtime.

  • If ever this is absolutely needed, it's possible to access the original function at runtime with __builtins__.__builtins___.setrecursionlimit.

  • ADD - a minimum threshold for the REC_LIMIT value of 20 is required. A BuildError is raised otherwise.

  • FIX - reorganize a bit the runtime steps, to catch errors that could occur in pyodide, but not while running the user's code

  • ADD - a message asking to contact the webmaster, if ever the above case occur (this means there is either a problem in the website code, or in the exercice configuration itself).

  • Some cleanup here and there, adding enforcing some contracts on the communication python <-> JS, ...

Modification effectuée par Frederic Zinelli

Rapports de requête de fusion