summaryrefslogtreecommitdiff
path: root/config.py
diff options
context:
space:
mode:
authorEmile Anclin <emile.anclin@logilab.fr>2010-11-02 18:08:55 +0100
committerEmile Anclin <emile.anclin@logilab.fr>2010-11-02 18:08:55 +0100
commitd4ac15ea474363cd8866dc5b56bb003db763c2a8 (patch)
treef735c77f393e2a5ef4ea345dbbdb732458248269 /config.py
parent329598bb0ee56a8b0e1d7b97ee1c19fc1b018184 (diff)
downloadpylint-git-d4ac15ea474363cd8866dc5b56bb003db763c2a8.tar.gz
py3k: pickle needs a byte IO
Diffstat (limited to 'config.py')
-rw-r--r--config.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/config.py b/config.py
index 97474a496..939ace1d5 100644
--- a/config.py
+++ b/config.py
@@ -60,14 +60,19 @@ def load_results(base):
except:
return {}
+if sys.version_info < (3, 0):
+ _PICK_MOD = 'w'
+else:
+ _PICK_MOD = 'wb'
+
def save_results(results, base):
"""pickle results"""
data_file = get_pdata_path(base, 1)
try:
- pickle.dump(results, open(data_file, 'w'))
+ pickle.dump(results, open(data_file, _PICK_MOD))
except (IOError, OSError), ex:
print >> sys.stderr, 'Unable to create file %s: %s' % (data_file, ex)
-
+
# location of the configuration file ##########################################