Skip to content
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

NameError: global name 'answer' is not defined #60

Open
nbareil opened this issue Jan 30, 2017 · 1 comment
Open

NameError: global name 'answer' is not defined #60

nbareil opened this issue Jan 30, 2017 · 1 comment

Comments

@nbareil
Copy link

nbareil commented Jan 30, 2017

Hello,

There is an undefined variable in the exception handler when open() fails in laika.py:

Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/local/lib/python2.7/dist-packages/laikaboss-2.0-py2.7.egg/EGG-INFO/scripts/laika.py", line 402, in run
    self.result_queue.put(answer)
NameError: global name 'answer' is not defined

Extract of the code:

396             try:
397                 with open(next_task) as nextfile:
398                     file_buffer = nextfile.read()
399             except IOError:
400                 logging.debug("Error opening: %s" % (next_task))
401                 self.task_queue.task_done()
402                 self.result_queue.put(answer)
403                 continue

I am not really sure how to fix this, sorry.

@Montana
Copy link

Montana commented Mar 8, 2023

Hi @nbareil ,

I wouldn't recommended, but an option you have is passing it to the function deposit by typing and to call it:

use deposit(answer)
def deposit(answer):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants