From 29add5e898a073a6b949eff1acf605901532730d Mon Sep 17 00:00:00 2001 From: Robert Taylor Date: Tue, 6 Dec 2022 01:50:49 +0000 Subject: [PATCH] Fix tutorial for python 3 --- pyproject.toml | 5 ++--- tutorial/src/tutorial.py | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 984efa3d..01b2b0bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,8 +16,7 @@ ninja = ">=1.10" cmake = ">=3" [tool.poetry.scripts] - -blif2vst = 'Coriolis:blif2vst' +blif2vst = 'Coriolis:blif2vst' cx2y = 'Coriolis:cx2y' cyclop = 'Corilis:cyclop' tutorial = 'Coriolis:tutorial' @@ -25,6 +24,6 @@ unittests = 'Coriolis:unittests' yosys_coriolis = 'Coriolis:yosys_coriolis' [build-system] -requires = ["poetry-core", "setuptools", "cmake"] +requires = ["poetry-core", "setuptools", "cmake", "patchelf"] build-backend = "poetry.core.masonry.api" diff --git a/tutorial/src/tutorial.py b/tutorial/src/tutorial.py index a536db22..651af79e 100755 --- a/tutorial/src/tutorial.py +++ b/tutorial/src/tutorial.py @@ -12,7 +12,7 @@ try: import CRL import Unicorn import Tutorial -except ImportError, e: +except ImportError as e: serror = str(e) if serror.startswith('No module named'): module = serror.split()[-1] @@ -24,7 +24,7 @@ except ImportError, e: print( ' Under RHEL 6, you must be under devtoolset-2.' ) print( ' (scl enable devtoolset-2 bash)' ) sys.exit(1) -except Exception, e: +except Exception as e: print( '[ERROR] A strange exception occurred while loading the basic Coriolis/Python' ) print( ' modules. Something may be wrong at Python/C API level.\n' ) print( ' {}'.format(e) ) @@ -108,6 +108,6 @@ if __name__ == '__main__': if cell: unicorn.setCell(cell) unicorn.show() ha.qtExec() - except Exception, e: + except Exception as e: helpers.io.catch( e ) sys.exit(0)