1
0
mirror of https://github.com/mnaberez/py65.git synced 2024-12-28 15:29:40 +00:00

Fix missing attribute exc.message

This commit is contained in:
Mike Naberezny 2013-10-26 15:48:13 -07:00
parent a792672b35
commit f43a4c2048
2 changed files with 5 additions and 5 deletions

View File

@ -58,7 +58,7 @@ class Monitor(cmd.Cmd):
longopts = ['help', 'mpu=', 'load=', 'rom=', 'goto=']
options, args = getopt.getopt(argv[1:], shortopts, longopts)
except getopt.GetoptError as exc:
self._output(exc.message)
self._output(exc.args[0])
self._usage()
self._exit(1)
@ -509,7 +509,7 @@ class Monitor(cmd.Cmd):
intval &= self.byteMask
setattr(self._mpu, register, intval)
except KeyError as exc:
self._output(exc.message)
self._output(exc.args[0])
def help_cd(self):
self._output("cd <directory>")

View File

@ -50,7 +50,7 @@ class AddressParserTests(unittest.TestCase):
parser.number('bad_label')
self.fail()
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):
parser = AddressParser()
@ -96,7 +96,7 @@ class AddressParserTests(unittest.TestCase):
parser.number('bad_label+3')
self.fail()
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):
parser = AddressParser()
@ -105,7 +105,7 @@ class AddressParserTests(unittest.TestCase):
parser.number('#$foo')
self.fail()
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):
parser = AddressParser()