mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Merge remote-tracking branch 'tor-github/pr/1757/head' into maint-0.4.3
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user