From f8bc560e2a395d2f74d61dc401ca71d9c8008eda 2013-10-09 21:31:22 From: Thomas Kluyver Date: 2013-10-09 21:31:22 Subject: [PATCH] Merge pull request #4342 from abhinav-upadhyay/unnessary-variable-assignment Return value directly from the try block and avoid a variable --- diff --git a/IPython/lib/deepreload.py b/IPython/lib/deepreload.py index 77dc04f..4410696 100644 --- a/IPython/lib/deepreload.py +++ b/IPython/lib/deepreload.py @@ -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 diff --git a/IPython/lib/latextools.py b/IPython/lib/latextools.py index 58df20b..c475ce4 100644 --- a/IPython/lib/latextools.py +++ b/IPython/lib/latextools.py @@ -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):