Patchwork D12237: tests: unconditionalize _unified_diff

login
register
mail settings
Submitter phabricator
Date March 2, 2022, 12:38 a.m.
Message ID <differential-rev-PHID-DREV-e7earozq6d6ibqi626gw-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50577/
State New
Headers show

Comments

phabricator - March 2, 2022, 12:38 a.m.
indygreg created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Now that we're Python 3 only we can make this logic simpler.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12237

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -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):