[damned-lies] Fix diff function under Python3
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Fix diff function under Python3
- Date: Wed, 22 Feb 2017 13:01:19 +0000 (UTC)
commit 5f5a7096bb417a4aba37e8de9a4120cc5298a197
Author: Claude Paroz <claude 2xlibre net>
Date: Wed Feb 22 12:05:38 2017 +0100
Fix diff function under Python3
Note that this commit starts dropping Python 2 support.
stats/potdiff.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/stats/potdiff.py b/stats/potdiff.py
index fe37444..7fa0d1e 100644
--- a/stats/potdiff.py
+++ b/stats/potdiff.py
@@ -24,14 +24,14 @@ from __future__ import unicode_literals
USE_DIFFLIB = 0
def diff(pota, potb):
- """Returns a list of differing lines between two files."""
+ """Returns a list of differing lines between two text files."""
with open(pota, "r") as f1:
- data1 = f1.read().decode('utf-8')
+ data1 = f1.read()
res1 = _parse_contents(data1)
res1.sort()
with open(potb, "r") as f2:
- data2 = f2.read().decode('utf-8')
+ data2 = f2.read()
res2 = _parse_contents(data2)
res2.sort()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]