added tests and refactored incorrect docstrings

This commit is contained in:
niphlod
2014-05-29 23:34:32 +02:00
parent 91d6834f0e
commit f1606ee091
4 changed files with 61 additions and 13 deletions
+2 -1
View File
@@ -197,8 +197,9 @@ class RestrictedError(Exception):
def compile2(code, layer):
"""
The +'\n' is necessary else compile fails when code ends in a comment.
The ``+'\\n'`` is necessary else compile fails when code ends in a comment.
"""
return compile(code.rstrip().replace('\r\n', '\n') + '\n', layer, 'exec')