summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolay Orlyuk <virkony@gmail.com>2019-01-17 23:30:33 +0100
committerNikolay Orlyuk <virkony@gmail.com>2019-01-17 23:30:33 +0100
commitaf0e2a48443e501d1eebfc69e92b35f36752a951 (patch)
treecae101207515667b3f6728ca9fa64f892345f45c
parentd11aa5d00081aec00405f1b54a00363caa7c28e7 (diff)
downloadpygments-af0e2a48443e501d1eebfc69e92b35f36752a951.tar.gz
Use unicode literals in docstrings as well
Resolves #1492
-rw-r--r--pygments/lexers/qvt.py2
-rw-r--r--pygments/styles/arduino.py4
-rw-r--r--pygments/styles/paraiso_dark.py2
-rw-r--r--pygments/styles/paraiso_light.py2
-rw-r--r--tests/test_cmdline.py13
5 files changed, 15 insertions, 8 deletions
diff --git a/pygments/lexers/qvt.py b/pygments/lexers/qvt.py
index af091a65..9b2559b1 100644
--- a/pygments/lexers/qvt.py
+++ b/pygments/lexers/qvt.py
@@ -18,7 +18,7 @@ __all__ = ['QVToLexer']
class QVToLexer(RegexLexer):
- """
+ u"""
For the `QVT Operational Mapping language <http://www.omg.org/spec/QVT/1.1/>`_.
Reference for implementing this: «Meta Object Facility (MOF) 2.0
diff --git a/pygments/styles/arduino.py b/pygments/styles/arduino.py
index 57e3809e..b500b6d9 100644
--- a/pygments/styles/arduino.py
+++ b/pygments/styles/arduino.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-"""
+u"""
pygments.styles.arduino
~~~~~~~~~~~~~~~~~~~~~~~
@@ -15,7 +15,7 @@ from pygments.token import Keyword, Name, Comment, String, Error, \
class ArduinoStyle(Style):
- """
+ u"""
The Arduino® language style. This style is designed to highlight the
Arduino source code, so exepect the best results with it.
"""
diff --git a/pygments/styles/paraiso_dark.py b/pygments/styles/paraiso_dark.py
index 5f334bb9..68abb9f6 100644
--- a/pygments/styles/paraiso_dark.py
+++ b/pygments/styles/paraiso_dark.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-"""
+u"""
pygments.styles.paraiso_dark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/pygments/styles/paraiso_light.py b/pygments/styles/paraiso_light.py
index a8112819..186e4775 100644
--- a/pygments/styles/paraiso_light.py
+++ b/pygments/styles/paraiso_light.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-"""
+u"""
pygments.styles.paraiso_light
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py
index 1500c875..a55e30ec 100644
--- a/tests/test_cmdline.py
+++ b/tests/test_cmdline.py
@@ -28,6 +28,13 @@ def func(args):
'''
+def _decode_output(text):
+ try:
+ return text.decode('utf-8')
+ except UnicodeEncodeError: # implicit encode on Python 2 with data loss
+ return text
+
+
def run_cmdline(*args, **kwds):
saved_stdin = sys.stdin
saved_stdout = sys.stdout
@@ -53,9 +60,9 @@ def run_cmdline(*args, **kwds):
sys.stderr = saved_stderr
new_stdout.flush()
new_stderr.flush()
- out, err = stdout_buffer.getvalue().decode('utf-8'), \
- stderr_buffer.getvalue().decode('utf-8')
- return (ret, out, err)
+ out, err = stdout_buffer.getvalue(), \
+ stderr_buffer.getvalue()
+ return (ret, _decode_output(out), _decode_output(err))
class CmdLineTest(unittest.TestCase):