diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-02-20 10:44:43 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-02-20 10:44:43 -0500 |
commit | 7ba7f9c0de9d1b2435a01961379b3d85c4fc2ab5 (patch) | |
tree | 98c27a67b04d8d8e04d4236033f16ae418161983 /scripts/maint/practracker | |
parent | 66bbdadbbe452a3f2d3d266a0951c15fbef6589b (diff) | |
parent | 7b4250286962da0f8dc6731d7f1c8cec9ccb4146 (diff) | |
download | tor-7ba7f9c0de9d1b2435a01961379b3d85c4fc2ab5.tar.gz tor-7ba7f9c0de9d1b2435a01961379b3d85c4fc2ab5.zip |
Merge branch 'maint-0.4.3'
Diffstat (limited to 'scripts/maint/practracker')
-rwxr-xr-x | scripts/maint/practracker/practracker.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/scripts/maint/practracker/practracker.py b/scripts/maint/practracker/practracker.py index b6a1f78137..76ffd64cfb 100755 --- a/scripts/maint/practracker/practracker.py +++ b/scripts/maint/practracker/practracker.py @@ -24,7 +24,7 @@ from __future__ import division from __future__ import print_function from __future__ import unicode_literals -import os, sys +import codecs, os, sys import metrics import util @@ -63,12 +63,8 @@ TOR_TOPDIR = None ####################################################### -if sys.version_info[0] <= 2: - def open_file(fname): - return open(fname, 'r') -else: - def open_file(fname): - return open(fname, 'r', encoding='utf-8') +def open_file(fname): + return codecs.open(fname, 'r', encoding='utf-8') def consider_file_size(fname, f): """Consider the size of 'f' and yield an FileSizeItem for it. |