From ce824d674074edd5a562c11af4f25bd5d08a3c17 2014-03-06 19:49:15 From: Thomas Kluyver Date: 2014-03-06 19:49:15 Subject: [PATCH] Merge pull request #5226 from bouk/fix-pythonstartup Don't run PYTHONSTARTUP file if a file or code is passed --- diff --git a/IPython/core/shellapp.py b/IPython/core/shellapp.py index afee8eb..159d530 100644 --- a/IPython/core/shellapp.py +++ b/IPython/core/shellapp.py @@ -358,7 +358,7 @@ class InteractiveShellApp(Configurable): """Run files from profile startup directory""" startup_dir = self.profile_dir.startup_dir startup_files = [] - if self.exec_PYTHONSTARTUP: + if self.exec_PYTHONSTARTUP and not (self.file_to_run or self.code_to_run or self.module_to_run): if os.environ.get('PYTHONSTARTUP', False): startup_files.append(os.environ['PYTHONSTARTUP']) startup_files += glob.glob(os.path.join(startup_dir, '*.py'))