clawpack / visclaw

Clawpack visualization tools
http://www.clawpack.org
BSD 3-Clause "New" or "Revised" License
29 stars 47 forks source link

reload() built-in function in frametools.py #206

Closed xinshengqin closed 7 years ago

xinshengqin commented 7 years ago

With python 2.7.6, running python $CLAW/visclaw/src/python/visclaw/plotclaw.py _output _plots setplot.py in an example directory gives: UnboundLocalError: local variable 'reload' referenced before assignment for line 1506: reload(setplot_module) in file "$CLAW/visclaw/src/python/visclaw/frametools.py".

If I comment out lines 1466 to 1471: if sys.version_info[0] >= 3: if sys.version_info[1] >= 4: from importlib import reload else: from imp import reload

everything works fine. Although the two lines that import the reload function from importlib or imp module is never executed since I used python2.7, they seem to affect the execution of the reload() built-in function later.

Every submodule is checkout at origin/master. visclaw is at 3f9b25a

mandli commented 7 years ago

I think this is the same problem as discussed at #204.

xinshengqin commented 7 years ago

Found it! Thanks!

mandli commented 7 years ago

205 should now have fixed this. Can you check to make sure and then close this issue?