question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

try/except in objmode fails with NameError

See original GitHub issue

Reporting a bug

This

from numba import jit

@jit(forceobj=True)
def foo():
    try:
        pass
    except:
        pass

foo()

fails with:

NameError: global name 'mark_try_block' is not defined

works fine in nopython mode.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
stuartarchibaldcommented, Dec 21, 2020

Is there a significant difference between this issue and #5377?

The code path to get to this point is different. Fixing one would hopefully fix the other, but not guaranteed.

1reaction
gmarkallcommented, Nov 19, 2020

@guilhermeleobas I’ve assigned you the issue 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

numba/numba - Gitter
Hi everybody, I have a piece of code written using numba but its throwing me an error. Was wondering if I could get...
Read more >
python - NameError, global not defined when using try,except
When I run this code I get the error. except NoSuchObject as objectname: NameError: global name 'NoSuchObject' is not defined.
Read more >
8. Errors and Exceptions — Python 3.11.1 documentation
There are (at least) two distinguishable kinds of errors: syntax error... ... the types in the example are ZeroDivisionError , NameError and TypeError...
Read more >
NameError Exception in Python
Learn to handle Name Error exception in python using the try-except block.
Read more >
NameError: Name plot_cases_simple is Not Defined
You'll see what a NameError is, some code examples to show how/why the error occurs, and how to fix them. What Is a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found