Skip to content

Commit

Permalink
Merge pull request ipython#4342 from abhinav-upadhyay/unnessary-varia…
Browse files Browse the repository at this point in the history
…ble-assignment

Return value directly from the try block and avoid a variable
  • Loading branch information
takluyver committed Oct 9, 2013
2 parents 29d544c + aac2271 commit cceb0b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions IPython/lib/deepreload.py
Expand Up @@ -328,10 +328,9 @@ def reload(module, exclude=['sys', 'os.path', '__builtin__', '__main__']):
found_now[i] = 1
try:
with replace_import_hook(deep_import_hook):
ret = deep_reload_hook(module)
return deep_reload_hook(module)
finally:
found_now = {}
return ret

# Uncomment the following to automatically activate deep reloading whenever
# this module is imported
Expand Down
3 changes: 1 addition & 2 deletions IPython/lib/latextools.py
Expand Up @@ -143,10 +143,9 @@ def latex_to_png_dvipng(s, wrap):
stdout=devnull, stderr=devnull)

with open(outfile, "rb") as f:
bin_data = f.read()
return f.read()
finally:
shutil.rmtree(workdir)
return bin_data


def kpsewhich(filename):
Expand Down

0 comments on commit cceb0b4

Please sign in to comment.