From d14df7365ff98dfd49c3ec329a36b6239f17a813 2015-11-08 18:08:10 From: Rémy Léone Date: 2015-11-08 18:08:10 Subject: [PATCH] Dict litteral --- diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 6d0bbad..ce6fa1c 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -804,11 +804,10 @@ class InteractiveShell(SingletonConfigurable): This has to be called after self.user_module is created. """ - self._orig_sys_module_state = {} - self._orig_sys_module_state['stdin'] = sys.stdin - self._orig_sys_module_state['stdout'] = sys.stdout - self._orig_sys_module_state['stderr'] = sys.stderr - self._orig_sys_module_state['excepthook'] = sys.excepthook + self._orig_sys_module_state = {'stdin': sys.stdin, + 'stdout': sys.stdout, + 'stderr': sys.stderr, + 'excepthook': sys.excepthook} self._orig_sys_modules_main_name = self.user_module.__name__ self._orig_sys_modules_main_mod = sys.modules.get(self.user_module.__name__) diff --git a/IPython/testing/iptest.py b/IPython/testing/iptest.py index 9e3ea7f..2dc6eef 100644 --- a/IPython/testing/iptest.py +++ b/IPython/testing/iptest.py @@ -115,11 +115,9 @@ def test_for(item, min_version=None, callback=extract_version): # Global dict where we can store information on what we have and what we don't # have available at test run time -have = {} - -have['matplotlib'] = test_for('matplotlib') -have['pygments'] = test_for('pygments') -have['sqlite3'] = test_for('sqlite3') +have = {'matplotlib': test_for('matplotlib'), + 'pygments': test_for('pygments'), + 'sqlite3': test_for('sqlite3')} #----------------------------------------------------------------------------- # Test suite definitions