Skip to content

Commit 4d275da

Browse files
committed
remove six dep
1 parent ec3cc4a commit 4d275da

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

ffsubsync/file_utils.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
import six
32
import sys
43

54

@@ -13,11 +12,8 @@ def __init__(self, filename, *args, **kwargs) -> None:
1312
self.closing = kwargs.pop("closing", False)
1413
if filename is None:
1514
stream = sys.stdout if "w" in args else sys.stdin
16-
if six.PY3:
17-
self.fh = open(stream.fileno(), *args, **kwargs)
18-
else:
19-
self.fh = stream
20-
elif isinstance(filename, six.string_types):
15+
self.fh = open(stream.fileno(), *args, **kwargs)
16+
elif isinstance(filename, str):
2117
self.fh = open(filename, *args, **kwargs)
2218
self.closing = True
2319
else:

ffsubsync/generic_subtitles.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import pysubs2
99
import srt
10-
import six
1110
import sys
1211

1312

@@ -158,13 +157,8 @@ def write_file(self, fname: str) -> None:
158157
else:
159158
raise NotImplementedError("unsupported output format: %s" % out_format)
160159

161-
to_write = to_write.encode(self._encoding)
162-
if six.PY3:
163-
with open(fname or sys.stdout.fileno(), "wb") as f:
164-
f.write(to_write)
165-
else:
166-
with (fname and open(fname, "wb")) or sys.stdout as f:
167-
f.write(to_write)
160+
with open(fname or sys.stdout.fileno(), "wb") as f:
161+
f.write(to_write.encode(self._encoding))
168162

169163

170164
class SubsMixin:

requirements-dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ pytest-cov
66
pyyaml
77
twine
88
types-requests
9-
types-six
109
versioneer

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ pysubs2;python_version<'3.7'
88
pysubs2>=1.2.0;python_version>='3.7'
99
rich
1010
setuptools
11-
six
1211
srt>=3.0.0
1312
tqdm
1413
typing_extensions

0 commit comments

Comments
 (0)