Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F1431261
_compat.py
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jan 18, 4:00 PM
Size
404 B
Mime Type
text/plain
Expires
Tue, Jan 20, 4:00 PM (1 d, 10 h)
Engine
blob
Format
Raw Data
Handle
326500
Attached To
rDJANGONOCAPTCHA django-nocaptcha-recaptcha
_compat.py
View Options
import
sys
PY2
=
sys
.
version_info
[
0
]
==
2
if
PY2
:
text_type
=
unicode
from
urllib2
import
Request
,
urlopen
from
urllib
import
urlencode
else
:
from
urllib.request
import
Request
,
urlopen
from
urllib.parse
import
urlencode
text_type
=
str
def
want_bytes
(
s
,
encoding
=
'utf-8'
,
errors
=
'strict'
):
if
isinstance
(
s
,
text_type
):
s
=
s
.
encode
(
encoding
,
errors
)
return
s
Event Timeline
Log In to Comment