summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Action.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2010-04-09 18:39:21 (GMT)
committerSteven Knight <knight@baldmt.com>2010-04-09 18:39:21 (GMT)
commit766675b428700a8f73e92f7e3de6d8d456fc2b99 (patch)
tree34ec773572713ff2f125ba74023b7466e6c4436a /src/engine/SCons/Action.py
parent608d04e42b0de175c29b806517d4a32a594fa493 (diff)
downloadSCons-766675b428700a8f73e92f7e3de6d8d456fc2b99.zip
SCons-766675b428700a8f73e92f7e3de6d8d456fc2b99.tar.gz
SCons-766675b428700a8f73e92f7e3de6d8d456fc2b99.tar.bz2
Issue 2331: For forward compatibility, use "import pickle" and have
the SCons.compat layer import cPickle as pickle when it's available.
Diffstat (limited to 'src/engine/SCons/Action.py')
-rw-r--r--src/engine/SCons/Action.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py
index da68b7d..ff67b49 100644
--- a/src/engine/SCons/Action.py
+++ b/src/engine/SCons/Action.py
@@ -100,9 +100,12 @@ from __future__ import generators ### KEEP FOR COMPATIBILITY FIXERS
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import cPickle
+import SCons.compat
+
import dis
import os
+# compat layer imports "cPickle" for us if it's available.
+import pickle
import re
import sys
import subprocess
@@ -208,8 +211,8 @@ def _object_contents(obj):
except AttributeError:
# Should be a pickable Python object.
try:
- return cPickle.dumps(obj)
- except (cPickle.PicklingError, TypeError):
+ return pickle.dumps(obj)
+ except (pickle.PicklingError, TypeError):
# This is weird, but it seems that nested classes
# are unpickable. The Python docs say it should
# always be a PicklingError, but some Python