Skip to content

Commit 23ef84e

Browse files
authored
Fix Python 2 CI (#2210)
* Fix Python 2 CI * Fix python symlink related tests
1 parent c72886a commit 23ef84e

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,21 @@ jobs:
2727
key: ${{ matrix.os }}-cache-pip
2828

2929
- name: Set up Python ${{ matrix.python-version }}
30+
if: matrix.python-version != '2.7'
3031
uses: actions/setup-python@v4
3132
with:
3233
python-version: ${{ matrix.python-version }}
3334

35+
- name: Set up Python 2.7
36+
if: matrix.python-version == '2.7'
37+
run: |
38+
sudo apt-get update
39+
sudo apt-get install -y \
40+
python2.7 python2.7-dev python2-pip-whl
41+
export PYTHONPATH=`echo /usr/share/python-wheels/pip-*py2*.whl`
42+
sudo --preserve-env=PYTHONPATH python2.7 -m pip install --upgrade pip setuptools wheel
43+
sudo ln -sf python2.7 /usr/bin/python
44+
3445
- name: Verify tag against version
3546
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
3647
env:

pwnlib/libcdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def unstrip_libc(filename):
217217
>>> libc = ELF(filename)
218218
>>> hex(libc.symbols.main_arena)
219219
'0x219c80'
220-
>>> unstrip_libc(which('python'))
220+
>>> unstrip_libc(which('python3'))
221221
False
222222
>>> filename = search_by_build_id('d1704d25fbbb72fa95d517b883131828c0883fe9', unstrip=True)
223223
>>> 'main_arena' in ELF(filename).symbols

pwnlib/tubes/ssh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,10 +1151,10 @@ def system(self, process, tty = True, wd = None, env = None, timeout = None, raw
11511151
11521152
Examples:
11531153
>>> s = ssh(host='example.pwnme')
1154-
>>> py = s.run('python -i')
1154+
>>> py = s.run('python3 -i')
11551155
>>> _ = py.recvuntil(b'>>> ')
11561156
>>> py.sendline(b'print(2+2)')
1157-
>>> py.sendline(b'exit')
1157+
>>> py.sendline(b'exit()')
11581158
>>> print(repr(py.recvline()))
11591159
b'4\n'
11601160
>>> s.system('env | grep -a AAAA', env={'AAAA': b'\x90'}).recvall()

0 commit comments

Comments
 (0)