コード例 #1
0
 def checkCollector2295(self):
     from RestrictedPython.RCompile import RestrictedCompileMode
     gen = RestrictedCompileMode('if False:\n  pass\n# Me Grok, Say Hi',
                                 '<testing>')
     gen.mode = 'exec'
     # if the source has any line ending other than \n by the time
     # parse() is called, then you'll get a syntax error.
     gen.parse()
コード例 #2
0
 def checkLineEndingsRestrictedCompileMode(self):
     from RestrictedPython.RCompile import RestrictedCompileMode
     gen = RestrictedCompileMode(
         '# testing\r\nprint "testing"\r\nreturn printed\n', '<testing>')
     gen.mode = 'exec'
     # if the source has any line ending other than \n by the time
     # parse() is called, then you'll get a syntax error.
     gen.parse()
コード例 #3
0
 def checkCollector2295(self):
     from RestrictedPython.RCompile import RestrictedCompileMode
     gen = RestrictedCompileMode(
         'if False:\n  pass\n# Me Grok, Say Hi',
         '<testing>'
         )
     gen.mode='exec'
     # if the source has any line ending other than \n by the time
     # parse() is called, then you'll get a syntax error.
     gen.parse()
コード例 #4
0
 def checkLineEndingsRestrictedCompileMode(self):
     from RestrictedPython.RCompile import RestrictedCompileMode
     gen = RestrictedCompileMode(
         '# testing\r\nprint "testing"\r\nreturn printed\n',
         '<testing>'
         )
     gen.mode='exec'
     # if the source has any line ending other than \n by the time
     # parse() is called, then you'll get a syntax error.
     gen.parse()