flatcam/tests/other/destructor_test.py
Marius Stanciu a4bbb98bf1 - converted from Python2 code to Python3 code
- in camlib.py, CNCJob class -> generate_from_excellon_by_tool() was
failing in the line to sort the tools due of been unable to compare
between dict's. I replaced that section.
2018-05-26 04:43:40 +03:00

34 lines
596 B
Python

import sys
from PyQt4 import QtCore, QtGui
class MyObj():
def __init__(self):
pass
def __del__(self):
print("##### Destroyed ######")
def parse():
o = MyObj()
raise Exception("Intentional Exception")
class Example(QtGui.QWidget):
def __init__(self):
super(Example, self).__init__()
qbtn = QtGui.QPushButton('Raise', self)
qbtn.clicked.connect(parse)
self.setWindowTitle('Quit button')
self.show()
if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())