diff options
Diffstat (limited to 'pygments/util.py')
-rw-r--r-- | pygments/util.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pygments/util.py b/pygments/util.py index b5e5d0b6..22fab2fe 100644 --- a/pygments/util.py +++ b/pygments/util.py @@ -367,7 +367,12 @@ else: u_prefix = '' iteritems = dict.items itervalues = dict.values - from io import StringIO, BytesIO + from io import StringIO, BytesIO, TextIOWrapper + + class UnclosingTextIOWrapper(TextIOWrapper): + # Don't close underlying buffer on destruction. + def close(self): + pass def add_metaclass(metaclass): |