From 5b4d85f852128b217251b59e337fb49c162cb908 Mon Sep 17 00:00:00 2001 From: Takayuki Kamiyama Date: Wed, 1 Nov 2023 11:11:59 +0900 Subject: [PATCH] Update. --- pake.py | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/pake.py b/pake.py index 25821c8..4acaaa1 100644 --- a/pake.py +++ b/pake.py @@ -1,15 +1,29 @@ -# Run, unit/xunit.py +import gc -print('----------------------------------------------------------------------') +try: + print('---------------------------------------------------------------') -with open('./unit/xunit.py') as xut: - xcmd = xut.read() - exec(xcmd) + # Run, unit/xunit.py + with open('./unit/xunit.py') as xut: + xcmd = xut.read() + exec(xcmd) -print('----------------------------------------------------------------------') + print('---------------------------------------------------------------') -# Run, unit/unit.py + # Run, unit/unit.py + with open('./unit/unit.py') as ut: + cmd = ut.read() + exec(cmd) -with open('./unit/unit.py') as ut: - cmd = ut.read() - exec(cmd) +except Exception as ext: + print(ext) + raise RuntimeError from None + + # Custom Exception. +except ValueError as ext: + print(ext) + raise RuntimeError from None + +finally: + # GC collection. + gc.collect()