summaryrefslogtreecommitdiff
path: root/pygments/formatters/terminal.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2020-02-29 15:45:08 +0100
committerGitHub <noreply@github.com>2020-02-29 15:45:08 +0100
commit35544e2fc6eed0ce4a27ec7285aac71ff0ddc473 (patch)
tree4390507bf0d4d5a4596cfc57c575da12f9da40f9 /pygments/formatters/terminal.py
parent14fc057d300102d88a07eda5558f238d49dd23f6 (diff)
downloadpygments-git-35544e2fc6eed0ce4a27ec7285aac71ff0ddc473.tar.gz
Remove Python 2 compatibility (#1348)
* Remove Python 2 compatibility * remove 2/3 shims in pygments.util * update setup.py metadata * Remove unneeded object inheritance. * Remove unneeded future imports.
Diffstat (limited to 'pygments/formatters/terminal.py')
-rw-r--r--pygments/formatters/terminal.py6
1 files changed, 0 insertions, 6 deletions
diff --git a/pygments/formatters/terminal.py b/pygments/formatters/terminal.py
index e60bde91..f0f3d7ae 100644
--- a/pygments/formatters/terminal.py
+++ b/pygments/formatters/terminal.py
@@ -92,12 +92,6 @@ class TerminalFormatter(Formatter):
self._lineno = 0
def format(self, tokensource, outfile):
- # hack: if the output is a terminal and has an encoding set,
- # use that to avoid unicode encode problems
- if not self.encoding and hasattr(outfile, "encoding") and \
- hasattr(outfile, "isatty") and outfile.isatty() and \
- sys.version_info < (3,):
- self.encoding = outfile.encoding
return Formatter.format(self, tokensource, outfile)
def _write_lineno(self, outfile):