From 846e92528043476155eae24049ab15aca6ca3bad Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Wed, 3 Feb 2021 13:16:18 -0800 Subject: [PATCH] PYTHON-2537 Fix benchmark when using Python 3 (#565) --- .evergreen/run-perf-tests.sh | 2 +- test/performance/perf_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.evergreen/run-perf-tests.sh b/.evergreen/run-perf-tests.sh index 41f154b73..cdf598c3b 100644 --- a/.evergreen/run-perf-tests.sh +++ b/.evergreen/run-perf-tests.sh @@ -22,7 +22,7 @@ pip install simplejson python setup.py build_ext -i start_time=$(date +%s) -python test/performance/perf_test.py +python test/performance/perf_test.py --locals end_time=$(date +%s) elapsed_secs=$((end_time-start_time)) diff --git a/test/performance/perf_test.py b/test/performance/perf_test.py index 4a2ba2fea..9f6e268df 100644 --- a/test/performance/perf_test.py +++ b/test/performance/perf_test.py @@ -399,7 +399,7 @@ def insert_json_file_with_file_id(filename): def read_json_file(filename): coll = proc_client.perftest.corpus - temp = tempfile.TemporaryFile() + temp = tempfile.TemporaryFile(mode='w') try: temp.writelines( [json.dumps(doc) + '\n' for