Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay committed Dec 3, 2024
2 parents cb26174 + 4eb6cec commit 822c8a2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
os: [macos-latest, ubuntu-22.04, windows-latest]
python: ['3.7', '3.8', '3.9', '3.10']
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
include:
- os: ubuntu-20.04
python: '3.6'
Expand Down
2 changes: 0 additions & 2 deletions CODEOWNERS

This file was deleted.

22 changes: 9 additions & 13 deletions osrf_pycommon/process_utils/execute_process_nopty.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,14 @@ def yield_to_stream(data, stream):


def _execute_process_nopty(cmd, cwd, env, shell, stderr_to_stdout=True):
if stderr_to_stdout:
p = Popen(cmd,
stdin=PIPE, stdout=PIPE, stderr=STDOUT,
cwd=cwd, env=env, shell=shell, close_fds=False)
else:
p = Popen(cmd,
stdin=PIPE, stdout=PIPE, stderr=PIPE,
cwd=cwd, env=env, shell=shell, close_fds=False)

# Left over data from read which isn't a complete line yet
left_overs = {p.stdout: b'', p.stderr: b''}
stderr = STDOUT if stderr_to_stdout else PIPE
with Popen(
cmd, stdin=PIPE, stdout=PIPE, stderr=stderr,
cwd=cwd, env=env, shell=shell, close_fds=False
) as p:
# Left over data from read which isn't a complete line yet
left_overs = {p.stdout: b'', p.stderr: b''}

fds = list(filter(None, [p.stdout, p.stderr]))
fds = list(filter(None, [p.stdout, p.stderr]))

return _yield_data(p, fds, left_overs, os.linesep)
yield from _yield_data(p, fds, left_overs, os.linesep)
2 changes: 1 addition & 1 deletion stdeb.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[DEFAULT]
Depends3: python3-setuptools, python3-importlib-metadata
Conflicts3: python-osrf-pycommon
Suite3: focal jammy bullseye bookworm
Suite3: focal jammy noble bookworm trixie
X-Python3-Version: >= 3.8
No-Python2:
1 change: 1 addition & 0 deletions tests/unit/test_process_utils/impl_aep_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ async def run(cmd, **kwargs):
transport, protocol = await async_execute_process(
create_protocol(), cmd, **kwargs)
retcode = await protocol.complete
transport.close()
return protocol.stdout_buffer, protocol.stderr_buffer, retcode

0 comments on commit 822c8a2

Please sign in to comment.