diff options
| author | Georg Brandl <georg@python.org> | 2010-07-28 18:43:40 +0200 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2010-07-28 18:43:40 +0200 |
| commit | 695f93d286f8ea23fff15c92b8d675b36aa592db (patch) | |
| tree | 85432ca89066315dacf89c686e87cb5aa463d94a /sphinx/util/pycompat.py | |
| parent | 6a24d9f7f17e469fd9f222613ef0353cb54f04b6 (diff) | |
| download | sphinx-695f93d286f8ea23fff15c92b8d675b36aa592db.tar.gz | |
Move the "b" function to pycompat.
Diffstat (limited to 'sphinx/util/pycompat.py')
| -rw-r--r-- | sphinx/util/pycompat.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sphinx/util/pycompat.py b/sphinx/util/pycompat.py index 7bf768fa..8787a144 100644 --- a/sphinx/util/pycompat.py +++ b/sphinx/util/pycompat.py @@ -26,6 +26,14 @@ except NameError: base_exception = Exception +# the ubiquitous "bytes" helper function +if sys.version_info > (3, 0): + def b(s): + return s.encode('utf-8') +else: + b = str + + try: any = any all = all |
