diff --git a/email/sphinxcontrib/email.py b/email/sphinxcontrib/email.py index 8823ea8..1c45e18 100644 --- a/email/sphinxcontrib/email.py +++ b/email/sphinxcontrib/email.py @@ -10,9 +10,14 @@ # a BSD license. import re -import string -rot_13_trans = string.maketrans( +try: + maketrans = ''.maketrans +except AttributeError: + # fallback for Python 2 + from string import maketrans + +rot_13_trans = maketrans( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', 'NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm' ) @@ -57,7 +62,6 @@ def email_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): """ Role to obfuscate e-mail addresses. """ - print 123456789, text, '\n\n' text = text.decode('utf-8').encode('utf-8') # Handle addresses of the form "Name " if '<' in text and '>' in text: @@ -76,4 +80,3 @@ def email_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): def setup(app): app.add_role('email', email_role) -