diff --git a/IPython/core/application.py b/IPython/core/application.py index bf2ab7e..07a393a 100644 --- a/IPython/core/application.py +++ b/IPython/core/application.py @@ -289,7 +289,7 @@ class BaseIPythonApplication(Application): except ConfigFileNotFound: # Only warn if the default config file was NOT being used. if config_file_name in self.config_file_specified: - msg = self.log.warn + msg = self.log.warning else: msg = self.log.debug msg("Config file not found, skipping: %s", config_file_name) @@ -297,7 +297,7 @@ class BaseIPythonApplication(Application): # For testing purposes. if not suppress_errors: raise - self.log.warn("Error loading config file: %s" % + self.log.warning("Error loading config file: %s" % self.config_file_name, exc_info=True) def init_profile_dir(self): @@ -364,7 +364,7 @@ class BaseIPythonApplication(Application): cfg = self.config_file_name if path and os.path.exists(os.path.join(path, cfg)): - self.log.warn("Staging %r from %s into %r [overwrite=%s]"%( + self.log.warning("Staging %r from %s into %r [overwrite=%s]"%( cfg, src, self.profile_dir.location, self.overwrite) ) self.profile_dir.copy_config_file(cfg, path=path, overwrite=self.overwrite) @@ -379,7 +379,7 @@ class BaseIPythonApplication(Application): cfg = os.path.basename(fullpath) if self.profile_dir.copy_config_file(cfg, path=path, overwrite=False): # file was copied - self.log.warn("Staging bundled %s from %s into %r"%( + self.log.warning("Staging bundled %s from %s into %r"%( cfg, self.profile, self.profile_dir.location) ) @@ -389,7 +389,7 @@ class BaseIPythonApplication(Application): s = self.generate_config_file() fname = os.path.join(self.profile_dir.location, self.config_file_name) if self.overwrite or not os.path.exists(fname): - self.log.warn("Generating default config file: %r"%(fname)) + self.log.warning("Generating default config file: %r"%(fname)) with open(fname, 'w') as f: f.write(s) @@ -407,4 +407,3 @@ class BaseIPythonApplication(Application): self.load_config_file() # enforce cl-opts override configfile opts: self.update_config(cl_config) - diff --git a/IPython/core/profileapp.py b/IPython/core/profileapp.py index c8a33dc..fecdc0d 100644 --- a/IPython/core/profileapp.py +++ b/IPython/core/profileapp.py @@ -252,7 +252,7 @@ class ProfileCreate(BaseIPythonApplication): except ImportError: self.log.info("Couldn't import %s, config file will be excluded", name) except Exception: - self.log.warn('Unexpected error importing %s', name, exc_info=True) + self.log.warning('Unexpected error importing %s', name, exc_info=True) return app def init_config_files(self): diff --git a/IPython/core/profiledir.py b/IPython/core/profiledir.py index 75bed35..7818f4e 100644 --- a/IPython/core/profiledir.py +++ b/IPython/core/profiledir.py @@ -87,7 +87,7 @@ class ProfileDir(LoggingConfigurable): try: os.chmod(path, mode) except OSError: - self.log.warn( + self.log.warning( "Could not set permissions on %s", path ) diff --git a/IPython/core/shellapp.py b/IPython/core/shellapp.py index 1afbcb0..f923337 100644 --- a/IPython/core/shellapp.py +++ b/IPython/core/shellapp.py @@ -231,11 +231,11 @@ class InteractiveShellApp(Configurable): try: r = enable(key) except ImportError: - self.log.warn("Eventloop or matplotlib integration failed. Is matplotlib installed?") + self.log.warning("Eventloop or matplotlib integration failed. Is matplotlib installed?") self.shell.showtraceback() return except Exception: - self.log.warn("GUI event loop or pylab initialization failed") + self.log.warning("GUI event loop or pylab initialization failed") self.shell.showtraceback() return @@ -273,11 +273,11 @@ class InteractiveShellApp(Configurable): ext=ext, location=self.profile_dir.location )) - self.log.warn(msg, exc_info=True) + self.log.warning(msg, exc_info=True) except: if self.reraise_ipython_extension_failures: raise - self.log.warn("Unknown error in loading extensions:", exc_info=True) + self.log.warning("Unknown error in loading extensions:", exc_info=True) def init_code(self): """run the pre-flight code, specified via exec_lines""" @@ -310,18 +310,18 @@ class InteractiveShellApp(Configurable): line) self.shell.run_cell(line, store_history=False) except: - self.log.warn("Error in executing line in user " + self.log.warning("Error in executing line in user " "namespace: %s" % line) self.shell.showtraceback() except: - self.log.warn("Unknown error in handling IPythonApp.exec_lines:") + self.log.warning("Unknown error in handling IPythonApp.exec_lines:") self.shell.showtraceback() def _exec_file(self, fname, shell_futures=False): try: full_filename = filefind(fname, [u'.', self.ipython_dir]) except IOError as e: - self.log.warn("File not found: %r"%fname) + self.log.warning("File not found: %r"%fname) return # Make sure that the running script gets a proper sys.argv as if it # were run from a system shell. @@ -362,7 +362,7 @@ class InteractiveShellApp(Configurable): try: self._exec_file(python_startup) except: - self.log.warn("Unknown error in handling PYTHONSTARTUP file %s:", python_startup) + self.log.warning("Unknown error in handling PYTHONSTARTUP file %s:", python_startup) self.shell.showtraceback() finally: # Many PYTHONSTARTUP files set up the readline completions, @@ -381,7 +381,7 @@ class InteractiveShellApp(Configurable): for fname in sorted(startup_files): self._exec_file(fname) except: - self.log.warn("Unknown error in handling startup files:") + self.log.warning("Unknown error in handling startup files:") self.shell.showtraceback() def _run_exec_files(self): @@ -394,7 +394,7 @@ class InteractiveShellApp(Configurable): for fname in self.exec_files: self._exec_file(fname) except: - self.log.warn("Unknown error in handling IPythonApp.exec_files:") + self.log.warning("Unknown error in handling IPythonApp.exec_files:") self.shell.showtraceback() def _run_cmd_line_code(self): @@ -406,7 +406,7 @@ class InteractiveShellApp(Configurable): line) self.shell.run_cell(line, store_history=False) except: - self.log.warn("Error in executing line in user namespace: %s" % + self.log.warning("Error in executing line in user namespace: %s" % line) self.shell.showtraceback()