[llvm] a281770 - [UpdateTestChecks][NFC] Drop a python2 workaround

Alex Richardson via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 28 09:57:59 PDT 2021


Author: Alex Richardson
Date: 2021-09-28T17:57:36+01:00
New Revision: a28177035b16e8884107be686a805f82e8f35840

URL: https://github.com/llvm/llvm-project/commit/a28177035b16e8884107be686a805f82e8f35840
DIFF: https://github.com/llvm/llvm-project/commit/a28177035b16e8884107be686a805f82e8f35840.diff

LOG: [UpdateTestChecks][NFC] Drop a python2 workaround

Added: 
    

Modified: 
    llvm/utils/UpdateTestChecks/common.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py
index 3bc908923bcf1..5cb5eb473e288 100644
--- a/llvm/utils/UpdateTestChecks/common.py
+++ b/llvm/utils/UpdateTestChecks/common.py
@@ -7,12 +7,6 @@
 import subprocess
 import sys
 
-if sys.version_info[0] > 2:
-  class string:
-    expandtabs = str.expandtabs
-else:
-  import string
-
 ##### Common utilities for update_*test_checks.py
 
 
@@ -266,7 +260,7 @@ def scrub_body(body):
   # whitespace in place.
   body = SCRUB_WHITESPACE_RE.sub(r' ', body)
   # Expand the tabs used for indentation.
-  body = string.expandtabs(body, 2)
+  body = str.expandtabs(body, 2)
   # Strip trailing whitespace.
   body = SCRUB_TRAILING_WHITESPACE_TEST_RE.sub(r'', body)
   return body


        


More information about the llvm-commits mailing list