summaryrefslogtreecommitdiff
path: root/src/maker/Maker.py
diff options
context:
space:
mode:
authorrahulp132022-02-22 01:42:24 +0530
committerrahulp132022-02-22 01:42:24 +0530
commitab7dd7ed89899e2a17f70262e83437f50f2a924f (patch)
tree877c274a597ecbc89d9b89856423d8be6051ddb8 /src/maker/Maker.py
parent2b0b878d72c74e3a335b346362eaa533c5459821 (diff)
downloadeSim-ab7dd7ed89899e2a17f70262e83437f50f2a924f.tar.gz
eSim-ab7dd7ed89899e2a17f70262e83437f50f2a924f.tar.bz2
eSim-ab7dd7ed89899e2a17f70262e83437f50f2a924f.zip
Fixed saving empty file crash issue
Diffstat (limited to 'src/maker/Maker.py')
-rwxr-xr-xsrc/maker/Maker.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/maker/Maker.py b/src/maker/Maker.py
index f3f8b93e..6d97e4d3 100755
--- a/src/maker/Maker.py
+++ b/src/maker/Maker.py
@@ -194,8 +194,18 @@ class Maker(QtWidgets.QWidget):
# This function is used to save the edited file in eSim
def save(self):
- wr = self.entry_var[1].toPlainText()
- open(self.verilogfile, "w+").write(wr)
+ try:
+ wr = self.entry_var[1].toPlainText()
+ open(self.verilogfile, "w+").write(wr)
+ except BaseException as err:
+ self.msg = QtWidgets.QErrorMessage(self)
+ self.msg.setModal(True)
+ self.msg.setWindowTitle("Error Message")
+ self.msg.showMessage(
+ "Error in saving verilog file. Please check if it is chosen."
+ )
+ self.msg.exec_()
+ print("Error in saving verilog file: " + str(err))
# This is used to run the makerchip-app
def runmakerchip(self):