Finalize Python3 support

Set the environment variable PYTHONHASHSEED to 0 to have
predictive tests under Python 3.

Change-Id: Ia15a9383e0f20bd0e4572e9f9b9772f1704dff86
This commit is contained in:
Frederic Lepied
2014-04-26 23:34:58 +02:00
parent f2e0610628
commit 628c541a69
10 changed files with 86 additions and 38 deletions
+2 -1
View File
@@ -267,7 +267,8 @@ def get_file_size(file_obj):
:param file_obj: file-like object.
:retval The file's size or None if it cannot be determined.
"""
if hasattr(file_obj, 'seek') and hasattr(file_obj, 'tell'):
if (hasattr(file_obj, 'seek') and hasattr(file_obj, 'tell') and
(six.PY2 or six.PY3 and file_obj.seekable())):
try:
curr = file_obj.tell()
file_obj.seek(0, os.SEEK_END)