Skip to content

Commit

Permalink
Merge pull request #43 from kennydo/kedo-update-pipes
Browse files Browse the repository at this point in the history
Import `quote` from `shlex` instead of `pipes`
  • Loading branch information
chriskuehl authored Feb 21, 2023
2 parents f74fac9 + 3fb8480 commit 0fb4696
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repos:
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://gitlab.com/pycqa/flake8
- repo: https://github.com/pycqa/flake8
rev: 3.7.1
hooks:
- id: flake8
Expand Down
2 changes: 1 addition & 1 deletion aactivator.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import stat
import sys
from os.path import relpath
from pipes import quote
from shlex import quote


ENVIRONMENT_VARIABLE = 'AACTIVATOR_ACTIVE'
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
platforms='linux',
classifiers=[
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
python_requires='>=3.3',
py_modules=['aactivator'],
entry_points={
'console_scripts': [
Expand Down
10 changes: 8 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@
from __future__ import print_function
from __future__ import unicode_literals

import os

import pytest
from py._path.local import LocalPath


@pytest.fixture(autouse=True)
def cwd():
with LocalPath('/').as_cwd():
old_dir = os.getcwd()
os.chdir('/')

try:
yield
finally:
os.chdir(old_dir)


@pytest.fixture
Expand Down
4 changes: 1 addition & 3 deletions tests/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import re
import shutil
import sys
from shlex import quote

import pexpect
import pytest
Expand Down Expand Up @@ -60,8 +61,6 @@ def expect_exact_better(proc, expected):
proc.buffer.replace(b'\r', b'').replace(b'\n', b'\n ').decode('utf8'),
)
message = '\n'.join(message)
if sys.version_info < (3, 0):
message = message.encode('utf8')
raise AssertionError(message)


Expand Down Expand Up @@ -114,7 +113,6 @@ def parse_tests(tests):

def shellquote(cmd):
"""transform a python command-list to a shell command-string"""
from pipes import quote
return ' '.join(quote(arg) for arg in cmd)


Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27,py36
envlist = py36

[testenv]
deps = -rrequirements-dev.txt
Expand Down

0 comments on commit 0fb4696

Please sign in to comment.