Skip to content

Commit

Permalink
subprocess.run -> run_subprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
LysandreJik committed Apr 18, 2022
1 parent 18e6e87 commit 858f067
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 266 deletions.
10 changes: 4 additions & 6 deletions src/huggingface_hub/commands/user.py
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 858f067

Please sign in to comment.