Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subprocess.run -> run_subprocess #352

Merged
merged 5 commits into from Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/huggingface_hub/commands/user.py
Expand Up @@ -26,6 +26,8 @@
from huggingface_hub.hf_api import HfApi, HfFolder
from requests.exceptions import HTTPError

from ..utils import run_subprocess


class UserCommands(BaseHuggingfaceCLICommand):
@staticmethod
Expand Down Expand Up @@ -122,13 +124,9 @@ def tabulate(rows: List[List[Union[str, int]]], headers: List[str]) -> str:

def currently_setup_credential_helpers(directory=None) -> List[str]:
try:
output = subprocess.run(
output = run_subprocess(
"git config --list".split(),
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
encoding="utf-8",
check=True,
cwd=directory,
directory,
).stdout.split("\n")

current_credential_helpers = []
Expand Down