summaryrefslogtreecommitdiffstats
path: root/Lib/codecs.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/codecs.py')
-rw-r--r--Lib/codecs.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/codecs.py b/Lib/codecs.py
index c1c55d8..82f2398 100644
--- a/Lib/codecs.py
+++ b/Lib/codecs.py
@@ -414,6 +414,9 @@ class StreamWriter(Codec):
def __exit__(self, type, value, tb):
self.stream.close()
+ def __reduce_ex__(self, proto):
+ raise TypeError("can't serialize %s" % self.__class__.__name__)
+
###
class StreamReader(Codec):
@@ -663,6 +666,9 @@ class StreamReader(Codec):
def __exit__(self, type, value, tb):
self.stream.close()
+ def __reduce_ex__(self, proto):
+ raise TypeError("can't serialize %s" % self.__class__.__name__)
+
###
class StreamReaderWriter:
@@ -750,6 +756,9 @@ class StreamReaderWriter:
def __exit__(self, type, value, tb):
self.stream.close()
+ def __reduce_ex__(self, proto):
+ raise TypeError("can't serialize %s" % self.__class__.__name__)
+
###
class StreamRecoder:
@@ -866,6 +875,9 @@ class StreamRecoder:
def __exit__(self, type, value, tb):
self.stream.close()
+ def __reduce_ex__(self, proto):
+ raise TypeError("can't serialize %s" % self.__class__.__name__)
+
### Shortcuts
def open(filename, mode='r', encoding=None, errors='strict', buffering=-1):