https://github.com/cag/execgate
A safer python 3 exec.
https://github.com/cag/execgate
Last synced: 8 months ago
JSON representation
A safer python 3 exec.
- Host: GitHub
- URL: https://github.com/cag/execgate
- Owner: cag
- Created: 2013-07-19T06:10:50.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-07-19T07:44:39.000Z (almost 13 years ago)
- Last Synced: 2025-03-12T05:02:32.987Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 105 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
execgate
========
A safer python 3 exec.
Usage:
from execgate import gated_exec, gated_eval, GateSecurityError
foo = gated_eval('1 + 1')
try:
gated_exec("""[
c for c in
().__class__.__bases__[0].__subclasses__()
if c.__name__ == "Quitter"
][0](0)()""")
except GateSecurityError:
print("You are a baaaad monkey.")