Handle SystemExit separately from Exception (python <= 2.4)

This commit is contained in:
Davlet Panech 2010-09-20 17:15:43 -04:00
parent b323952e63
commit 82b2667ef7

View File

@ -771,6 +771,12 @@ def load_data():
if __name__ == "__main__":
try:
ret = load_data()
# SystemExit inherits from Exception in python < 2.5, so we have to
# handle it separately.
except SystemExit, e:
sys.exit(e.code)
except Exception, e:
from pgloader.options import DEBUG
if DEBUG: