Skip to content

Commit 52815ef

Browse files
Resolve logger warnings (#24425)
## PR Summary This small PR migrates from the deprecated `logger.warn` to the recommended `logger.warning` method to solve: ```python DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead ```
1 parent be531bd commit 52815ef

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tools/building.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ def get_closure_compiler_and_env(user_args):
492492
if not native_closure_compiler_works and not any(a.startswith('--platform') for a in user_args):
493493
# Run with Java Closure compiler as a fallback if the native version does not work.
494494
# This can happen, for example, on arm64 macOS machines that do not have Rosetta installed.
495-
logger.warn('falling back to java version of closure compiler')
495+
logger.warning('falling back to java version of closure compiler')
496496
user_args.append('--platform=java')
497497
check_closure_compiler(closure_cmd, user_args, env, allowed_to_fail=False)
498498

@@ -675,7 +675,7 @@ def move_to_safe_7bit_ascii_filename(filename):
675675
if closure_warnings['error']:
676676
logger.error('Closure compiler completed with warnings and -Werror=closure enabled, aborting!\n')
677677
else:
678-
logger.warn('Closure compiler completed with warnings:\n')
678+
logger.warning('Closure compiler completed with warnings:\n')
679679

680680
# Print input file (long wall of text!)
681681
if DEBUG == 2 and (proc.returncode != 0 or (len(proc.stderr.strip()) > 0 and closure_warnings['enabled'])):
@@ -697,13 +697,13 @@ def move_to_safe_7bit_ascii_filename(filename):
697697
if closure_warnings['error']:
698698
logger.error(proc.stderr)
699699
else:
700-
logger.warn(proc.stderr)
700+
logger.warning(proc.stderr)
701701

702702
# Exit and/or print final hint to get clearer output
703703
if settings.MINIFY_WHITESPACE:
704-
logger.warn('(rerun with -g1 linker flag for an unminified output)')
704+
logger.warning('(rerun with -g1 linker flag for an unminified output)')
705705
elif DEBUG != 2:
706-
logger.warn('(rerun with EMCC_DEBUG=2 enabled to dump Closure input file)')
706+
logger.warning('(rerun with EMCC_DEBUG=2 enabled to dump Closure input file)')
707707

708708
if closure_warnings['error']:
709709
exit_with_error('closure compiler produced warnings and -W=error=closure enabled')

0 commit comments

Comments
 (0)