From 2827146e55742dbfdef07608fdf94734f9a284f0 Mon Sep 17 00:00:00 2001 From: "Mr. Outis" Date: Mon, 30 Dec 2019 19:45:51 -0600 Subject: [PATCH] py3: adapt TEXT_CHARS on istextfile.py --- dvc/istextfile.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/dvc/istextfile.py b/dvc/istextfile.py index a11a9ce1d..7d66da5bd 100644 --- a/dvc/istextfile.py +++ b/dvc/istextfile.py @@ -7,15 +7,7 @@ from dvc.utils.compat import open # perls-guess-if-file-is-text-or-binary-implemented-in-python -# A function that takes an integer in the 8-bit range and returns -# a single-character byte object in py3 / a single-character string -# in py2. -# -def _int2byte(i): - return bytes((i,)) - - -TEXT_CHARS = b"".join(_int2byte(i) for i in range(32, 127)) + b"\n\r\t\f\b" +TEXT_CHARS = bytes(range(32, 127)) + b"\n\r\t\f\b" def istextfile(fname, blocksize=512):