Bug in ex66 test.py!

Lorenzo_Pellegrino (770 points)
2 5 10
asked Feb 15 in Exam exercises by Lorenzo_Pellegrino (770 points)
recategorized Feb 15 by andrea.sterbini
It gives me this message:

Traceback (most recent call last):
  File "C:\Users\simon\anaconda3\lib\site-packages\ddt.py", line 182, in wrapper
    return func(self, *args, **kwargs)
  File "C:/Users/simon/Desktop/loren/eser/66/test.py", line 45, in test
    tree = tree.BinaryTree.fromList(lista)
UnboundLocalError: local variable 'tree' referenced before assignment

I tried to fix it but I'm not quite able to do that (it gives me another type of error), I think it's probably due to inappropriate naming of imports/parameters used in the test.py. But again I'm not sure if what I'm saying is correct.

(I already tried to substitute it with the original copy)
78 views

1 Answer

Best answer
andrea.sterbini (172780 points)
514 935 1789
answered Feb 15 by andrea.sterbini (172,780 points)
selected Feb 15 by Lorenzo_Pellegrino

Thanks for reporting it.

We renamed the original Italian module albero.py to tree.py, but this produced a name collision wrt  other tree named variables in test.py.

I have fixed the ZIP, re-download it.

Lorenzo_Pellegrino (770 points)
2 5 10
commented Feb 15 by Lorenzo_Pellegrino (770 points)
Thanks Professor
Lorenzo_Pellegrino (770 points)
2 5 10
commented Feb 15 by Lorenzo_Pellegrino (770 points)
Sorry Professor I've just downloaded it again and nothing seems to have changed. I see the exact same error.

(I refreshed the ex page)
andrea.sterbini (172780 points)
514 935 1789
commented Feb 15 by andrea.sterbini (172,780 points)
Try again, I have reloaded the apache server to un-cache the zip files.
Lorenzo_Pellegrino (770 points)
2 5 10
commented Feb 15 by Lorenzo_Pellegrino (770 points)
It is very strange, I tried again and it doesn't change