diff options
author | Georg Brandl <georg@python.org> | 2014-10-07 11:26:33 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-10-07 11:26:33 +0200 |
commit | 6ad969544fdd7bfeebb0360a9a4d025a3951f8bc (patch) | |
tree | 470506c2f1878433bbbdd8aa49a1b95b44a56521 /pygments/formatters/other.py | |
parent | abae5a16c927814de3b3f6f45bc0df94cf7ec9fa (diff) | |
download | pygments-6ad969544fdd7bfeebb0360a9a4d025a3951f8bc.tar.gz |
Closes #1013: allow "encoding" for the Raw formatter.
Diffstat (limited to 'pygments/formatters/other.py')
-rw-r--r-- | pygments/formatters/other.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/pygments/formatters/other.py b/pygments/formatters/other.py index c8269b19..d8e5f4f7 100644 --- a/pygments/formatters/other.py +++ b/pygments/formatters/other.py @@ -62,9 +62,8 @@ class RawTokenFormatter(Formatter): def __init__(self, **options): Formatter.__init__(self, **options) - if self.encoding: - raise OptionError('the raw formatter does not support the ' - 'encoding option') + # We ignore self.encoding if it is set, since it gets set for lexer + # and formatter if given with -Oencoding on the command line. self.encoding = 'ascii' # let pygments.format() do the right thing self.compress = get_choice_opt(options, 'compress', ['', 'none', 'gz', 'bz2'], '') |