Skip to content
Snippets Groups Projects
Commit adad0a0a authored by Mike Bayer's avatar Mike Bayer
Browse files

- [bug] The Babel plugin has been repaired to work on Python 3.

parent e14a6860
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,8 @@
is backwards incompatible vs. code that is relying upon a _('')
translation to be working within a call tag.
- [bug] The Babel plugin has been repaired to work on Python 3.
0.8.1
- [bug] Changed setup.py to skip installing markupsafe
if Python version is < 2.6 or is between 3.0 and
......
......@@ -18,6 +18,8 @@ if py3k:
binary_type = bytes
text_type = str
from io import BytesIO as byte_buffer
def u(s):
return s
......@@ -30,6 +32,9 @@ else:
from cStringIO import StringIO
except:
from StringIO import StringIO
byte_buffer = StringIO
from urllib import quote_plus, unquote_plus
from htmlentitydefs import codepoint2name, name2codepoint
string_types = basestring,
......
......@@ -113,10 +113,10 @@ def extract_nodes(nodes, keywords, comment_tags, options):
translator_comments = \
[comment[1] for comment in translator_comments]
if not compat.py3k and isinstance(code, compat.text_type):
if isinstance(code, compat.text_type):
code = code.encode('ascii', 'backslashreplace')
code = StringIO(code)
code = compat.byte_buffer(code)
for lineno, funcname, messages, python_translator_comments \
in extract_python(code, keywords, comment_tags, options):
yield (node.lineno + (lineno - 1), funcname, messages,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment