Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F1300533
_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
Wed, Nov 19, 2:14 PM
Size
404 B
Mime Type
text/plain
Expires
Fri, Nov 21, 2:14 PM (4 h, 7 s)
Engine
blob
Format
Raw Data
Handle
293637
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