mirror of
https://github.com/mnaberez/py65.git
synced 2024-12-29 06:29:48 +00:00
Fix missing attribute exc.message
This commit is contained in:
parent
a792672b35
commit
f43a4c2048
@ -58,7 +58,7 @@ class Monitor(cmd.Cmd):
|
|||||||
longopts = ['help', 'mpu=', 'load=', 'rom=', 'goto=']
|
longopts = ['help', 'mpu=', 'load=', 'rom=', 'goto=']
|
||||||
options, args = getopt.getopt(argv[1:], shortopts, longopts)
|
options, args = getopt.getopt(argv[1:], shortopts, longopts)
|
||||||
except getopt.GetoptError as exc:
|
except getopt.GetoptError as exc:
|
||||||
self._output(exc.message)
|
self._output(exc.args[0])
|
||||||
self._usage()
|
self._usage()
|
||||||
self._exit(1)
|
self._exit(1)
|
||||||
|
|
||||||
@ -509,7 +509,7 @@ class Monitor(cmd.Cmd):
|
|||||||
intval &= self.byteMask
|
intval &= self.byteMask
|
||||||
setattr(self._mpu, register, intval)
|
setattr(self._mpu, register, intval)
|
||||||
except KeyError as exc:
|
except KeyError as exc:
|
||||||
self._output(exc.message)
|
self._output(exc.args[0])
|
||||||
|
|
||||||
def help_cd(self):
|
def help_cd(self):
|
||||||
self._output("cd <directory>")
|
self._output("cd <directory>")
|
||||||
|
@ -50,7 +50,7 @@ class AddressParserTests(unittest.TestCase):
|
|||||||
parser.number('bad_label')
|
parser.number('bad_label')
|
||||||
self.fail()
|
self.fail()
|
||||||
except KeyError as exc:
|
except KeyError as exc:
|
||||||
self.assertEqual('Label not found: bad_label', exc.message)
|
self.assertEqual('Label not found: bad_label', exc.args[0])
|
||||||
|
|
||||||
def test_number_label_hex_offset(self):
|
def test_number_label_hex_offset(self):
|
||||||
parser = AddressParser()
|
parser = AddressParser()
|
||||||
@ -96,7 +96,7 @@ class AddressParserTests(unittest.TestCase):
|
|||||||
parser.number('bad_label+3')
|
parser.number('bad_label+3')
|
||||||
self.fail()
|
self.fail()
|
||||||
except KeyError as exc:
|
except KeyError as exc:
|
||||||
self.assertEqual('Label not found: bad_label', exc.message)
|
self.assertEqual('Label not found: bad_label', exc.args[0])
|
||||||
|
|
||||||
def test_number_bad_label_syntax(self):
|
def test_number_bad_label_syntax(self):
|
||||||
parser = AddressParser()
|
parser = AddressParser()
|
||||||
@ -105,7 +105,7 @@ class AddressParserTests(unittest.TestCase):
|
|||||||
parser.number('#$foo')
|
parser.number('#$foo')
|
||||||
self.fail()
|
self.fail()
|
||||||
except KeyError as exc:
|
except KeyError as exc:
|
||||||
self.assertEqual('Label not found: #$foo', exc.message)
|
self.assertEqual('Label not found: #$foo', exc.args[0])
|
||||||
|
|
||||||
def test_number_constrains_address_at_zero_or_above(self):
|
def test_number_constrains_address_at_zero_or_above(self):
|
||||||
parser = AddressParser()
|
parser = AddressParser()
|
||||||
|
Loading…
Reference in New Issue
Block a user