From 869e501544960f638edfe17c9d7500b54d05837e Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Thu, 19 Jul 2018 13:47:18 +0800 Subject: logging: use warning instead warn The warn method is deprecated. We should use the documented warning instead. Quoting from the python's official doc: """ Note: There is an obsolete method warn which is functionally identical to warning. As warn is deprecated, please do not use it - use warning instead. """ (From OE-Core rev: f467fd277eb77336097cfc0f5f329bdc8d0f70cb) Signed-off-by: Chen Qi Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- scripts/lib/recipetool/create_npm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/lib/recipetool/create_npm.py') diff --git a/scripts/lib/recipetool/create_npm.py b/scripts/lib/recipetool/create_npm.py index bb42a5ca5c..03667887fc 100644 --- a/scripts/lib/recipetool/create_npm.py +++ b/scripts/lib/recipetool/create_npm.py @@ -90,7 +90,7 @@ class NpmRecipeHandler(RecipeHandler): runenv = dict(os.environ, PATH=d.getVar('PATH')) bb.process.run('npm shrinkwrap', cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True) except bb.process.ExecutionError as e: - logger.warn('npm shrinkwrap failed:\n%s' % e.stdout) + logger.warning('npm shrinkwrap failed:\n%s' % e.stdout) return tmpfile = os.path.join(localfilesdir, 'npm-shrinkwrap.json') @@ -107,12 +107,12 @@ class NpmRecipeHandler(RecipeHandler): cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True) relockbin = os.path.join(NpmRecipeHandler.lockdownpath, 'node_modules', 'lockdown', 'relock.js') if not os.path.exists(relockbin): - logger.warn('Could not find relock.js within lockdown directory; skipping lockdown') + logger.warning('Could not find relock.js within lockdown directory; skipping lockdown') return try: bb.process.run('node %s' % relockbin, cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True) except bb.process.ExecutionError as e: - logger.warn('lockdown-relock failed:\n%s' % e.stdout) + logger.warning('lockdown-relock failed:\n%s' % e.stdout) return tmpfile = os.path.join(localfilesdir, 'lockdown.json') -- cgit v1.2.3-54-g00ecf