|
316 | 316 | import subprocess
|
317 | 317 | import sys
|
318 | 318 | from pathlib import Path
|
319 |
| -from typing import Callable |
| 319 | +from collections.abc import Callable |
320 | 320 | import functools
|
321 | 321 |
|
322 | 322 | have_tomllib = True
|
@@ -443,9 +443,9 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
|
443 | 443 |
|
444 | 444 | for command in commands:
|
445 | 445 | try:
|
446 |
| - dispcmd = str([command] + args) |
| 446 | + dispcmd = str([command, *args]) |
447 | 447 | # remember shell=False, so use git.cmd on windows, not just git
|
448 |
| - process = subprocess.Popen([command] + args, cwd=cwd, env=env, |
| 448 | + process = subprocess.Popen([command, *args], cwd=cwd, env=env, |
449 | 449 | stdout=subprocess.PIPE,
|
450 | 450 | stderr=(subprocess.PIPE if hide_stderr
|
451 | 451 | else None), **popen_kwargs)
|
@@ -1392,7 +1392,7 @@ def do_vcs_install(versionfile_source, ipy):
|
1392 | 1392 | with open(".gitattributes", "a+") as fobj:
|
1393 | 1393 | fobj.write(f"{versionfile_source} export-subst\n")
|
1394 | 1394 | files.append(".gitattributes")
|
1395 |
| - run_command(GITS, ["add", "--"] + files) |
| 1395 | + run_command(GITS, ["add", "--", *files]) |
1396 | 1396 |
|
1397 | 1397 |
|
1398 | 1398 | def versions_from_parentdir(parentdir_prefix, root, verbose):
|
@@ -2106,7 +2106,7 @@ def do_setup():
|
2106 | 2106 | cfg = get_config_from_root(root)
|
2107 | 2107 | except (OSError, configparser.NoSectionError,
|
2108 | 2108 | configparser.NoOptionError) as e:
|
2109 |
| - if isinstance(e, (OSError, configparser.NoSectionError)): |
| 2109 | + if isinstance(e, OSError | configparser.NoSectionError): |
2110 | 2110 | print("Adding sample versioneer config to setup.cfg",
|
2111 | 2111 | file=sys.stderr)
|
2112 | 2112 | with open(os.path.join(root, "setup.cfg"), "a") as f:
|
|
0 commit comments