Closed Ryan-Gordon1 closed 4 years ago
No, this cannot be done with RestrictedPython as a smaller number of lines does make a script less dangerous. Think of putting multiple statements into one line. If you want to measure numbers of lines you have to do this on your own.
Feel free to reopen if this does not answer your question.
Consider the usecase where I have RestrictedPython setup to compile potentially malicious scripts. As a part of Restrictions I would like to enforce a max number of lines in a script. Is this possible with RestrictedPython?
Example : With a restriction of say 5 lines max. The below would execute :
But this would raise an exception :