Index: tools/scan-build-py/libscanbuild/__init__.py =================================================================== --- tools/scan-build-py/libscanbuild/__init__.py +++ tools/scan-build-py/libscanbuild/__init__.py @@ -41,12 +41,6 @@ return predicate -def tempdir(): - """ Return the default temorary directory. """ - - return os.getenv('TMPDIR', os.getenv('TEMP', os.getenv('TMP', '/tmp'))) - - def run_build(command, *args, **kwargs): """ Run and report build command execution Index: tools/scan-build-py/libscanbuild/arguments.py =================================================================== --- tools/scan-build-py/libscanbuild/arguments.py +++ tools/scan-build-py/libscanbuild/arguments.py @@ -17,7 +17,8 @@ import sys import argparse import logging -from libscanbuild import reconfigure_logging, tempdir +import tempfile +from libscanbuild import reconfigure_logging from libscanbuild.clang import get_checkers __all__ = ['parse_args_for_intercept_build', 'parse_args_for_analyze_build', @@ -187,7 +188,7 @@ '--output', '-o', metavar='', - default=tempdir(), + default=tempfile.gettempdir(), help="""Specifies the output directory for analyzer reports. Subdirectory will be created if default directory is targeted.""") output.add_argument( Index: tools/scan-build-py/libscanbuild/intercept.py =================================================================== --- tools/scan-build-py/libscanbuild/intercept.py +++ tools/scan-build-py/libscanbuild/intercept.py @@ -31,7 +31,7 @@ from libear import build_libear, TemporaryDirectory from libscanbuild import command_entry_point, compiler_wrapper, \ wrapper_environment, run_command, run_build -from libscanbuild import duplicate_check, tempdir +from libscanbuild import duplicate_check from libscanbuild.compilation import split_command from libscanbuild.arguments import parse_args_for_intercept_build from libscanbuild.shell import encode, decode @@ -84,7 +84,7 @@ for entry in itertools.chain(previous, current) if os.path.exists(entry['file']) and not duplicate(entry)) - with TemporaryDirectory(prefix='intercept-', dir=tempdir()) as tmp_dir: + with TemporaryDirectory(prefix='intercept-') as tmp_dir: # run the build command environment = setup_environment(args, tmp_dir) exit_code = run_build(args.build, env=environment)