]> arthur.barton.de Git - bup.git/commitdiff
Drop vestigial compat.str_type
authorRob Browning <rlb@defaultvalue.org>
Sun, 9 Jan 2022 18:02:08 +0000 (12:02 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sun, 16 Jan 2022 20:39:05 +0000 (14:39 -0600)
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/compat.py
lib/bup/drecurse.py
lib/bup/helpers.py
lib/bup/vfs.py
test/lib/buptest/__init__.py

index 507a21e5367c1cfb4a66f4e78839ba3d8a7a9101..33e8c1da8cb6f9e1cd4f2f2dfec0569ec69bcc52 100644 (file)
@@ -10,7 +10,6 @@ from os import environb as environ
 from os import fsdecode, fsencode
 from shlex import quote
 
-str_type = str
 int_types = (int,)
 
 def hexstr(b):
index 84fbce608281f5c2a1cc0c1ffed8e5300cc68689..a5a04e9a424f785e7fb97041d91a2121362cdc0f 100644 (file)
@@ -2,7 +2,6 @@
 from __future__ import absolute_import
 import stat, os
 
-from bup.compat import str_type
 from bup.helpers \
     import (add_error,
             debug1,
@@ -89,7 +88,7 @@ def recursive_dirlist(paths, xdev, bup_dir=None,
                       xdev_exceptions=frozenset()):
     with finalized_fd(b'.') as startdir:
         try:
-            assert not isinstance(paths, str_type)
+            assert not isinstance(paths, str)
             for path in paths:
                 try:
                     pst = xstat.lstat(path)
index 0856699db5bb31bc2c72f901df8422e342716c39..2ac3075b0b6c234039370126e294052cf8649f3d 100644 (file)
@@ -286,7 +286,7 @@ def squote(x):
 def quote(x):
     if isinstance(x, bytes):
         return bquote(x)
-    if isinstance(x, compat.str_type):
+    if isinstance(x, str):
         return squote(x)
     assert False
     # some versions of pylint get confused
@@ -301,11 +301,11 @@ def shstr(cmd):
     call() and friends.  e.g. log(shstr(cmd)); call(cmd)
 
     """
-    if isinstance(cmd, (bytes, compat.str_type)):
+    if isinstance(cmd, (bytes, str)):
         return cmd
     elif all(isinstance(x, bytes) for x in cmd):
         return b' '.join(map(bquote, cmd))
-    elif all(isinstance(x, compat.str_type) for x in cmd):
+    elif all(isinstance(x, str) for x in cmd):
         return ' '.join(map(squote, cmd))
     raise TypeError('unsupported shstr argument: ' + repr(cmd))
 
index a16fb50a6483a8687323f956699bbfc4100742af..e68b60cc4e0a42a66e709224f598d1d567bb41b5 100644 (file)
@@ -57,7 +57,7 @@ from time import localtime, strftime
 import re, sys
 
 from bup import git, vint
-from bup.compat import hexstr, pending_raise, str_type
+from bup.compat import hexstr, pending_raise
 from bup.git import BUP_CHUNKED, parse_commit, tree_decode
 from bup.helpers import debug2, last, nullcontext_if_not
 from bup.io import path_msg
@@ -951,7 +951,7 @@ def _resolve_path(repo, path, parent=None, want_meta=True, follow=True):
     if parent:
         for x in parent:
             assert len(x) == 2
-            assert isinstance(x[0], (bytes, str_type))
+            assert isinstance(x[0], (bytes, str))
             assert isinstance(x[1], item_types)
         assert parent[0][1] == _root
         if not S_ISDIR(item_mode(parent[-1][1])):
index d9aeaaed56b53c022092cefb89d2e080773030e5..e2b5284da6eca9aacd04fc4a53b40e7d59ee568d 100644 (file)
@@ -9,7 +9,7 @@ from traceback import extract_stack
 import errno, os, subprocess, sys, tempfile
 
 from bup import helpers
-from bup.compat import fsencode, str_type
+from bup.compat import fsencode
 from bup.io import byte_stream
 
 
@@ -35,7 +35,7 @@ def run(cmd, check=True, input=None, **kwargs):
 
 def logcmd(cmd):
     s = helpers.shstr(cmd)
-    if isinstance(cmd, str_type):
+    if isinstance(cmd, str):
         print(s, file=sys.stderr)
     else:
         # bytes - for now just escape it