mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
Added byte/str compatibility for python 3
This commit is contained in:
10
djrill/compat.py
Normal file
10
djrill/compat.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# For python 3 compatibility, see http://python3porting.com/problems.html#nicer-solutions
|
||||
import sys
|
||||
|
||||
if sys.version < '3':
|
||||
def b(x):
|
||||
return x
|
||||
else:
|
||||
import codecs
|
||||
def b(x):
|
||||
return codecs.latin_1_encode(x)[0]
|
||||
Reference in New Issue
Block a user