[PATCH 8/9] Drop vestigial comapt.int_types

0 views
Skip to first unread message

Rob Browning

unread,
Jan 16, 2022, 3:51:30 PM1/16/22
to bup-...@googlegroups.com
Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---
lib/bup/cmd/prune_older.py | 4 ++--
lib/bup/compat.py | 2 --
lib/bup/main.py | 3 +--
3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/lib/bup/cmd/prune_older.py b/lib/bup/cmd/prune_older.py
index d5a8f1cf..900abd9a 100755
--- a/lib/bup/cmd/prune_older.py
+++ b/lib/bup/cmd/prune_older.py
@@ -7,7 +7,7 @@ from time import localtime, strftime, time
import sys

from bup import git, options
-from bup.compat import argv_bytes, int_types
+from bup.compat import argv_bytes
from bup.gc import bup_gc
from bup.helpers import die_if_errors, log, partition, period_as_secs
from bup.io import byte_stream
@@ -85,7 +85,7 @@ def main(argv):
o.fatal('refusing to run dangerous, experimental command without --unsafe')

now = int(time()) if opt.wrt is None else opt.wrt
- if not isinstance(now, int_types):
+ if not isinstance(now, int):
o.fatal('--wrt value ' + str(now) + ' is not an integer')

period_start = {}
diff --git a/lib/bup/compat.py b/lib/bup/compat.py
index 33e8c1da..e34c23a6 100644
--- a/lib/bup/compat.py
+++ b/lib/bup/compat.py
@@ -10,8 +10,6 @@ from os import environb as environ
from os import fsdecode, fsencode
from shlex import quote

-int_types = (int,)
-
def hexstr(b):
"""Return hex string (not bytes as with hexlify) representation of b."""
return b.hex()
diff --git a/lib/bup/main.py b/lib/bup/main.py
index b9654ccc..79ebca04 100755
--- a/lib/bup/main.py
+++ b/lib/bup/main.py
@@ -22,7 +22,6 @@ from bup.compat import (
add_ex_tb,
environ,
fsdecode,
- int_types,
wrap_main
)
from bup.compat import add_ex_tb, add_ex_ctx, wrap_main
@@ -234,7 +233,7 @@ def filter_output(srcs, dests):

"""
global sep_rx
- assert all(isinstance(x, int_types) for x in srcs)
+ assert all(isinstance(x, int) for x in srcs)
assert len(srcs) == len(dests)
srcs = tuple(srcs)
dest_for = dict(zip(srcs, dests))
--
2.30.2

Reply all
Reply to author
Forward
0 new messages