WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.2% of users enabled 2FA.

Commit bafdbc7a authored by Tobias Pape's avatar Tobias Pape
Browse files

Add target file and rework system exit

RPython does not like sys.exit, so we emulate it using an Exit-Exception.
Also, we add a proper target file
parent b8d3cc26
......@@ -18,7 +18,10 @@ from som.vm.shell import Shell
import som.compiler.sourcecode_compiler as sourcecode_compiler
import os
import sys
class Exit(BaseException):
def __init__(self, code):
self.code = code
class Universe(object):
......@@ -57,7 +60,7 @@ class Universe(object):
if self._avoid_exit:
self._last_exit_code = error_code
else:
sys.exit(error_code)
raise Exit(error_code)
def last_exit_code(self):
return self._last_exit_code
......@@ -597,7 +600,8 @@ def main(args):
u.exit(0)
if __name__ == '__main__':
import sys
try:
main(sys.argv)
def target(*args):
return main, None
except Exit as e:
sys.exit(e.code)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from som.vm.universe import main, Exit
from rpython.rlib import jit
#from rpython.rlib.debug import debug_start, debug_stop, debug_print
# __________ Entry points __________
def entry_point(argv):
try:
main(argv)
except Exit, e:
return e.code
return 1
# _____ Define and setup target ___
def target(driver, args):
driver.exe_name = 'som'
return entry_point, None
def jitpolicy(driver):
from rpython.jit.codewriter.policy import JitPolicy
return JitPolicy()
if __name__ == '__main__':
from rpython.translator.driver import TranslationDriver
f, _ = target(TranslationDriver(), sys.argv)
sys.exit(f(sys.argv))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment