From 8698198452840281bd311c157043d1dc7f2be445 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 18 Jul 2018 17:50:16 -0400 Subject: [PATCH] tools/update-authors-json: Avoid shelling out for cp. Signed-off-by: Anders Kaseorg --- tools/update-authors-json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/update-authors-json b/tools/update-authors-json index debb580905..b90b78a4b0 100755 --- a/tools/update-authors-json +++ b/tools/update-authors-json @@ -12,11 +12,11 @@ from typing import Any, Dict, List, Optional, Union, cast from mypy_extensions import TypedDict import os +import shutil import sys import argparse from time import sleep from datetime import date -import subprocess import requests import json @@ -147,7 +147,7 @@ def copy_fixture() -> None: Copy test fixture file from zerver/tests/fixtures. This is used to avoid constantly fetching data from Github during testing. """ - subprocess.check_call(['cp', FIXTURE_FILE, settings.CONTRIBUTORS_DATA]) + shutil.copyfile(FIXTURE_FILE, settings.CONTRIBUTORS_DATA) if args.use_fixture: