Skip to content

Commit 319c7f2

Browse files
committed
fix: always detect the host shell on MacOS
Signed-off-by: Frost Ming <[email protected]>
1 parent e5bdc07 commit 319c7f2

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ on:
66

77
jobs:
88
lint:
9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
12-
- uses: actions/setup-python@v2
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-python@v4
1313
- run: pip install black ruff
14-
- run: |
14+
- run: |
1515
ruff check src
1616
black --check src
1717
build:
@@ -20,13 +20,13 @@ jobs:
2020
strategy:
2121
matrix:
2222
platform: [ubuntu-latest, macos-latest, windows-latest]
23-
python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
23+
python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12']
2424

2525
steps:
26-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v4
2727

2828
- name: Set up Python ${{ matrix.python-version }}
29-
uses: actions/setup-python@v2
29+
uses: actions/setup-python@v4
3030
with:
3131
python-version: ${{ matrix.python-version }}
3232

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919

2020
- name: Install build dependencies
2121
run: python -m pip install --upgrade build

news/81.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a bug that ``detect_shell()`` always returns the host shell on MacOS.

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ classifier =
2222
Programming Language :: Python :: 3.9
2323
Programming Language :: Python :: 3.10
2424
Programming Language :: Python :: 3.11
25+
Programming Language :: Python :: 3.12
2526
Topic :: Software Development :: Libraries :: Python Modules
2627

2728
[options]

src/shellingham/posix/ps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def iter_process_parents(pid, max_depth=10):
3131
processes_mapping = {}
3232
for line in output.split("\n"):
3333
try:
34-
pid, ppid, args = line.strip().split(None, 2)
34+
_pid, ppid, args = line.strip().split(None, 2)
3535
# XXX: This is not right, but we are really out of options.
3636
# ps does not offer a sane way to decode the argument display,
3737
# and this is "Good Enough" for obtaining shell names. Hopefully
@@ -40,7 +40,7 @@ def iter_process_parents(pid, max_depth=10):
4040
args = tuple(a.strip() for a in args.split(" "))
4141
except ValueError:
4242
continue
43-
processes_mapping[pid] = Process(args=args, pid=pid, ppid=ppid)
43+
processes_mapping[_pid] = Process(args=args, pid=_pid, ppid=ppid)
4444

4545
for _ in range(max_depth):
4646
try:

0 commit comments

Comments
 (0)