tests: unconditionalize _unified_diff
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 20 Feb 2022 13:20:33 -0700
changeset 48859 f928dec9add7
parent 48858 9d01ab54df3f
child 48860 4cea98b32d95
tests: unconditionalize _unified_diff Now that we're Python 3 only we can make this logic simpler. Differential Revision: https://phab.mercurial-scm.org/D12237
tests/run-tests.py
--- a/tests/run-tests.py	Sun Feb 20 13:19:21 2022 -0700
+++ b/tests/run-tests.py	Sun Feb 20 13:20:33 2022 -0700
@@ -52,6 +52,7 @@
 import difflib
 import distutils.version as version
 import errno
+import functools
 import json
 import multiprocessing
 import os
@@ -879,11 +880,7 @@
                 pass
 
 
-_unified_diff = difflib.unified_diff
-if PYTHON3:
-    import functools
-
-    _unified_diff = functools.partial(difflib.diff_bytes, difflib.unified_diff)
+_unified_diff = functools.partial(difflib.diff_bytes, difflib.unified_diff)
 
 
 def getdiff(expected, output, ref, err):