summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2022-09-30 20:15:27 +0200
committerFlorian Bruhin <me@the-compiler.org>2022-09-30 20:23:38 +0200
commitfa62360357e13f464ff04759f293e2990cf4f489 (patch)
treedbd926d12fc58c0e8a36df6b66cd39e9704d019f
parent8c02ef69ecf6ed58f0069012311229f55040ec54 (diff)
downloadqutebrowser-fa62360357e13f464ff04759f293e2990cf4f489.tar.gz
qutebrowser-fa62360357e13f464ff04759f293e2990cf4f489.zip
Remove unneeded str
Only needed in Python 3.5 times
-rwxr-xr-xscripts/asciidoc2html.py6
-rw-r--r--scripts/dev/misc_checks.py6
-rwxr-xr-xscripts/mkvenv.py2
-rw-r--r--tests/end2end/features/test_downloads_bdd.py6
-rw-r--r--tests/helpers/fixtures.py2
-rw-r--r--tests/helpers/testutils.py4
-rw-r--r--tests/unit/browser/test_pdfjs.py2
-rw-r--r--tests/unit/browser/webkit/network/test_filescheme.py2
-rw-r--r--tests/unit/config/test_configfiles.py2
-rw-r--r--tests/unit/misc/test_editor.py2
10 files changed, 17 insertions, 17 deletions
diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py
index ba8493247..1b904736d 100755
--- a/scripts/asciidoc2html.py
+++ b/scripts/asciidoc2html.py
@@ -73,7 +73,7 @@ class AsciiDoc:
def cleanup(self) -> None:
"""Clean up the temporary home directory for asciidoc."""
if self._homedir is not None and not self._failed:
- shutil.rmtree(str(self._homedir))
+ shutil.rmtree(self._homedir)
def build(self) -> None:
"""Build either the website or the docs."""
@@ -119,7 +119,7 @@ class AsciiDoc:
for filename in ['cheatsheet-big.png', 'cheatsheet-small.png']:
src = REPO_ROOT / 'doc' / 'img' / filename
dst = dst_path / filename
- shutil.copy(str(src), str(dst))
+ shutil.copy(src, dst)
def _build_website_file(self, root: pathlib.Path, filename: str) -> None:
"""Build a single website file."""
@@ -131,7 +131,7 @@ class AsciiDoc:
assert self._tempdir is not None # for mypy
modified_src = self._tempdir / src.name
- shutil.copy(str(REPO_ROOT / 'www' / 'header.asciidoc'), modified_src)
+ shutil.copy(REPO_ROOT / 'www' / 'header.asciidoc', modified_src)
outfp = io.StringIO()
diff --git a/scripts/dev/misc_checks.py b/scripts/dev/misc_checks.py
index 908daad4d..6759fc474 100644
--- a/scripts/dev/misc_checks.py
+++ b/scripts/dev/misc_checks.py
@@ -64,7 +64,7 @@ def _get_files(
continue
try:
- with tokenize.open(str(path)):
+ with tokenize.open(path):
pass
except SyntaxError as e:
# Could not find encoding
@@ -274,7 +274,7 @@ def check_spelling(args: argparse.Namespace) -> Optional[bool]:
try:
ok = True
for path in _get_files(verbose=args.verbose, ignored=ignored):
- with tokenize.open(str(path)) as f:
+ with tokenize.open(path) as f:
if not _check_spelling_file(path, f, patterns):
ok = False
print()
@@ -292,7 +292,7 @@ def check_vcs_conflict(args: argparse.Namespace) -> Optional[bool]:
if path.suffix in {'.rst', '.asciidoc'}:
# False positives
continue
- with tokenize.open(str(path)) as f:
+ with tokenize.open(path) as f:
for line in f:
if any(line.startswith(c * 7) for c in '<>=|'):
print("Found conflict marker in {}".format(path))
diff --git a/scripts/mkvenv.py b/scripts/mkvenv.py
index 737ea145d..005c657a1 100755
--- a/scripts/mkvenv.py
+++ b/scripts/mkvenv.py
@@ -180,7 +180,7 @@ def delete_old_venv(venv_dir: pathlib.Path) -> None:
'remove it.'.format(venv_dir))
print_command('rm -r', venv_dir, venv=False)
- shutil.rmtree(str(venv_dir))
+ shutil.rmtree(venv_dir)
def create_venv(venv_dir: pathlib.Path, use_virtualenv: bool = False) -> None:
diff --git a/tests/end2end/features/test_downloads_bdd.py b/tests/end2end/features/test_downloads_bdd.py
index 804ed40fe..95707f710 100644
--- a/tests/end2end/features/test_downloads_bdd.py
+++ b/tests/end2end/features/test_downloads_bdd.py
@@ -38,7 +38,7 @@ def download_dir(tmpdir):
downloads.ensure(dir=True)
(downloads / 'subdir').ensure(dir=True)
try:
- os.mkfifo(str(downloads / 'fifo'))
+ os.mkfifo(downloads / 'fifo')
except AttributeError:
pass
unwritable = downloads / 'unwritable'
@@ -72,7 +72,7 @@ def check_ssl():
@bdd.when("the unwritable dir is unwritable")
def check_unwritable(tmpdir):
unwritable = tmpdir / 'downloads' / 'unwritable'
- if os.access(str(unwritable), os.W_OK):
+ if os.access(unwritable, os.W_OK):
# Docker container or similar
pytest.skip("Unwritable dir was writable")
@@ -166,4 +166,4 @@ def delete_file(tmpdir, filename):
def fifo_should_be_fifo(tmpdir):
download_dir = tmpdir / 'downloads'
assert download_dir.exists()
- assert not os.path.isfile(str(download_dir / 'fifo'))
+ assert not os.path.isfile(download_dir / 'fifo')
diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py
index cc362290f..c36bc98cb 100644
--- a/tests/helpers/fixtures.py
+++ b/tests/helpers/fixtures.py
@@ -717,7 +717,7 @@ def state_config(data_tmpdir, monkeypatch):
@pytest.fixture
def unwritable_tmp_path(tmp_path):
tmp_path.chmod(0)
- if os.access(str(tmp_path), os.W_OK):
+ if os.access(tmp_path, os.W_OK):
# Docker container or similar
pytest.skip("Directory was still writable")
diff --git a/tests/helpers/testutils.py b/tests/helpers/testutils.py
index c607718ab..4c6d253d7 100644
--- a/tests/helpers/testutils.py
+++ b/tests/helpers/testutils.py
@@ -224,11 +224,11 @@ def nop_contextmanager():
def change_cwd(path):
"""Use a path as current working directory."""
old_cwd = pathlib.Path.cwd()
- os.chdir(str(path))
+ os.chdir(path)
try:
yield
finally:
- os.chdir(str(old_cwd))
+ os.chdir(old_cwd)
@contextlib.contextmanager
diff --git a/tests/unit/browser/test_pdfjs.py b/tests/unit/browser/test_pdfjs.py
index 86b875be5..c1e8d2efe 100644
--- a/tests/unit/browser/test_pdfjs.py
+++ b/tests/unit/browser/test_pdfjs.py
@@ -178,7 +178,7 @@ def unreadable_file(tmpdir):
unreadable_file = tmpdir / 'unreadable'
unreadable_file.ensure()
unreadable_file.chmod(0)
- if os.access(str(unreadable_file), os.R_OK):
+ if os.access(unreadable_file, os.R_OK):
# Docker container or similar
pytest.skip("File was still readable")
diff --git a/tests/unit/browser/webkit/network/test_filescheme.py b/tests/unit/browser/webkit/network/test_filescheme.py
index 12cacb5a2..6d8b93fea 100644
--- a/tests/unit/browser/webkit/network/test_filescheme.py
+++ b/tests/unit/browser/webkit/network/test_filescheme.py
@@ -48,7 +48,7 @@ def test_get_file_list(tmpdir, create_file, create_dir, filterfunc, expected):
if create_file or create_dir:
path.ensure(dir=create_dir)
- all_files = os.listdir(str(tmpdir))
+ all_files = os.listdir(tmpdir)
result = filescheme.get_file_list(str(tmpdir), all_files, filterfunc)
item = {'name': 'foo', 'absname': str(path)}
diff --git a/tests/unit/config/test_configfiles.py b/tests/unit/config/test_configfiles.py
index 00bc8a806..f93986306 100644
--- a/tests/unit/config/test_configfiles.py
+++ b/tests/unit/config/test_configfiles.py
@@ -505,7 +505,7 @@ class TestYaml:
def unreadable_autoconfig(self, autoconfig):
autoconfig.fobj.ensure()
autoconfig.fobj.chmod(0)
- if os.access(str(autoconfig.fobj), os.R_OK):
+ if os.access(autoconfig.fobj, os.R_OK):
# Docker container or similar
pytest.skip("File was still readable")
diff --git a/tests/unit/misc/test_editor.py b/tests/unit/misc/test_editor.py
index 91bdce26b..bec775add 100644
--- a/tests/unit/misc/test_editor.py
+++ b/tests/unit/misc/test_editor.py
@@ -128,7 +128,7 @@ class TestFileHandling:
filename = pathlib.Path(editor._filename)
assert filename.exists()
filename.chmod(0o277)
- if os.access(str(filename), os.R_OK):
+ if os.access(filename, os.R_OK):
# Docker container or similar
pytest.skip("File was still readable")