Kar1o / endgame-singularity

Automatically exported from code.google.com/p/endgame-singularity
0 stars 0 forks source link

UnboundLocalError: local variable 'real_cpu' referenced before assignment #74

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I believe I had 2 stolen computer time bases active, with a third waiting
to be built (no CPU pool), with only 1 or 0.5 CPU time left on Arbitrage.

Now if I click on Finance it pops up the menu, with a traceback printed on
stdout.

This is with svn as of yesterday, 2009-03-03.

Exception in function show at Wed Mar  4 16:38:37 2009 MDT:
Traceback (most recent call last):
  File "/home/rhamph/src/endgame-singularity-read-only/code/safety.py",
line 58, in safe_call
    return func(*args, **kwargs)
  File
"/home/rhamph/src/endgame-singularity-read-only/code/graphics/dialog.py",
line 189, in show
    result = self.handle(event)
  File
"/home/rhamph/src/endgame-singularity-read-only/code/graphics/dialog.py",
line 306, in handle
    return self.call_handlers(handlers, event)
  File
"/home/rhamph/src/endgame-singularity-read-only/code/graphics/dialog.py",
line 318, in call_handlers
    handler(event)
  File
"/home/rhamph/src/endgame-singularity-read-only/code/graphics/button.py",
line 109, in handle_event
    self.activate_with_sound(event)
  File
"/home/rhamph/src/endgame-singularity-read-only/code/graphics/button.py",
line 122, in activate_with_sound
    self.activated(event)
  File
"/home/rhamph/src/endgame-singularity-read-only/code/graphics/button.py",
line 151, in activated
    self.function(*self.args, **self.kwargs)
  File
"/home/rhamph/src/endgame-singularity-read-only/code/graphics/button.py",
line 197, in show_dialog
    raise constants.Handled, dialog.call_dialog(self.dialog, self)
  File
"/home/rhamph/src/endgame-singularity-read-only/code/graphics/dialog.py",
line 96, in call_dialog
    retval = dialog.show()
  File
"/home/rhamph/src/endgame-singularity-read-only/code/screens/finance.py",
line 121, in show
    return super(FinanceScreen, self).show()
  File
"/home/rhamph/src/endgame-singularity-read-only/code/graphics/dialog.py",
line 175, in show
    Dialog.top.maybe_update()
  File
"/home/rhamph/src/endgame-singularity-read-only/code/graphics/widget.py",
line 297, in maybe_update
    self.update()
  File
"/home/rhamph/src/endgame-singularity-read-only/code/graphics/widget.py",
line 301, in update
    self.prepare_for_redraw()
  File
"/home/rhamph/src/endgame-singularity-read-only/code/graphics/widget.py",
line 293, in prepare_for_redraw
    child.prepare_for_redraw()
  File
"/home/rhamph/src/endgame-singularity-read-only/code/graphics/widget.py",
line 293, in prepare_for_redraw
    child.prepare_for_redraw()
  File
"/home/rhamph/src/endgame-singularity-read-only/code/graphics/widget.py",
line 280, in prepare_for_redraw
    self.rebuild()
  File
"/home/rhamph/src/endgame-singularity-read-only/code/screens/finance.py",
line 51, in rebuild
    cash_info, cpu_info = g.pl.give_time(seconds_left, dry_run=True)
  File "/home/rhamph/src/endgame-singularity-read-only/code/player.py",
line 298, in give_time
    cpu_available=real_cpu )[0]
UnboundLocalError: local variable 'real_cpu' referenced before assignment

Original issue reported on code.google.com by rha...@gmail.com on 4 Mar 2009 at 11:41

Attachments:

GoogleCodeExporter commented 9 years ago
I've since seen this quite a lot.  It seems it can happen any time in which you 
have
a base under construction.

Original comment by rha...@gmail.com on 11 Mar 2009 at 3:29

GoogleCodeExporter commented 9 years ago
I believe this was fixed in r943 just like issue 79; could you please check 
with the
lastest SVN?

Original comment by phil.bor...@gmail.com on 23 May 2009 at 3:35

GoogleCodeExporter commented 9 years ago
Tested with r944, it's fixed.

Original comment by rha...@gmail.com on 23 May 2009 at 11:42

GoogleCodeExporter commented 9 years ago
Rockin'.  Thanks for testing.

Original comment by phil.bor...@gmail.com on 23 May 2009 at 11:43