Skip to content

Remove deprecated comma form for catching multiple exceptions. #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Contributors to Opbasm

Kevin Thibedeau
Patrick Lehmann
Graeme Smecher

2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ If you are unfamiliar with the PicoBlaze architecture you can review the :doc:`r
Requirements
------------

Opbasm requires either Python 2.7 or Python 3.x and no additional libraries. The installation script depends on setuptools which will be installed if it isn't currently present in your Python distribution. Optional macro support is provided when m4 is installed. You can get optional colorized output from the scripts by installing the Python colorama package. The source is written in Python 2.7 syntax but will convert cleanly to Python 3 when the installer passes it through ``2to3``.
Opbasm requires Python 3.x and no additional libraries. The installation script depends on setuptools which will be installed if it isn't currently present in your Python distribution. Optional macro support is provided when m4 is installed. You can get optional colorized output from the scripts by installing the Python colorama package.


Download
Expand Down
20 changes: 10 additions & 10 deletions opbasm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ def printq(*args, **keys):

try:
templates = find_templates(options.template_file)
except StatementError, e:
except StatementError as e:
asm_error(*e.args, exit=1)
except FatalError, e:
except FatalError as e:
asm_error(str(e), exit=1)

# Make sure the extension of the generated VHDL file matches the template extension
Expand All @@ -304,7 +304,7 @@ def printq(*args, **keys):
vhdl_file = build_path(config.output_dir, options.module_name + vhdl_ext)
verilog_file = build_path(config.output_dir, options.module_name + '.v')

for hdl in templates.iterkeys():
for hdl in templates:
templates[hdl] = (templates[hdl], vhdl_file if hdl == 'vhdl' else verilog_file)

log_file = build_path(config.output_dir, options.module_name + '.log')
Expand Down Expand Up @@ -334,9 +334,9 @@ def printq(*args, **keys):

try:
assembled_code = asm.assemble_file(options.input_file)
except StatementError, e:
except StatementError as e:
asm_error(*e.args, exit=1, statement=e.statement)
except FatalError, e:
except FatalError as e:
asm_error(str(e), exit=1)


Expand All @@ -350,7 +350,7 @@ def printq(*args, **keys):

if len(templates) > 0:
printq(_('\n Found {}:').format(_('templates') if len(templates) > 1 else _('template')))
for f in templates.itervalues():
for f in templates.values():
printq(' ', f[0])


Expand Down Expand Up @@ -378,17 +378,17 @@ def printq(*args, **keys):
# Find longest template file name so we can align the warning messages
# about unmapped INIT fields.
if len(templates) > 0:
longest_name = max(len(v[1]) for v in templates.itervalues())
longest_name = max(len(v[1]) for v in templates.values())
else:
longest_name = 0

for hdl_name in templates.iterkeys():
for hdl_name in templates:
template_file, target_file = templates[hdl_name]
asm.write_template_file(template_file, target_file, longest_name)

except StatementError, e:
except StatementError as e:
asm_error(*e.args, exit=1, statement=e.statement)
except FatalError, e:
except FatalError as e:
asm_error(str(e), exit=1)

asm.write_formatted_source(config.output_dir)
Expand Down
Loading