diff --git a/cpp/build-support/lint_cpp_cli.py b/cpp/build-support/lint_cpp_cli.py index e0fee00cafa..aebe29eaeb7 100644 --- a/cpp/build-support/lint_cpp_cli.py +++ b/cpp/build-support/lint_cpp_cli.py @@ -98,7 +98,8 @@ def lint_files(): # Only run on header files if filename.endswith('.h'): - yield from lint_file(full_path) + for _ in lint_file(full_path): + yield _ if __name__ == '__main__': diff --git a/python/pyarrow/tests/test_flight.py b/python/pyarrow/tests/test_flight.py index a7e6e340c68..231daf4e301 100644 --- a/python/pyarrow/tests/test_flight.py +++ b/python/pyarrow/tests/test_flight.py @@ -23,14 +23,14 @@ import tempfile import threading import time +import traceback import pytest import pyarrow as pa -from pathlib import Path from pyarrow.compat import tobytes - +from pyarrow.util import pathlib flight = pytest.importorskip("pyarrow.flight") @@ -40,7 +40,7 @@ def resource_root(): if not os.environ.get("ARROW_TEST_DATA"): raise RuntimeError("Test resources not found; set " "ARROW_TEST_DATA to /testing") - return Path(os.environ["ARROW_TEST_DATA"]) / "flight" + return pathlib.Path(os.environ["ARROW_TEST_DATA"]) / "flight" def read_flight_resource(path): @@ -51,10 +51,11 @@ def read_flight_resource(path): try: with (root / path).open("rb") as f: return f.read() - except FileNotFoundError as e: + except FileNotFoundError: raise RuntimeError( "Test resource {} not found; did you initialize the " - "test resource submodule?".format(root / path)) from e + "test resource submodule?\n{}".format(root / path, + traceback.format_exc())) def example_tls_certs():