Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
365c3e8b
Kaydet (Commit)
365c3e8b
authored
Eyl 02, 2013
tarafından
Aymeric Augustin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replaced "not PY3" by "PY2", new in six 1.4.0.
üst
42920970
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
47 additions
and
49 deletions
+47
-49
__init__.py
django/contrib/auth/management/__init__.py
+1
-1
test_basic.py
django/contrib/auth/tests/test_basic.py
+2
-2
message.py
django/core/mail/message.py
+1
-1
base.py
django/db/backends/mysql/base.py
+1
-1
base.py
django/db/backends/oracle/base.py
+3
-3
base.py
django/db/backends/sqlite3/base.py
+1
-1
base.py
django/db/models/base.py
+2
-2
cookie.py
django/http/cookie.py
+1
-1
app_directories.py
django/template/loaders/app_directories.py
+2
-2
eggs.py
django/template/loaders/eggs.py
+1
-1
_os.py
django/utils/_os.py
+3
-3
encoding.py
django/utils/encoding.py
+1
-1
feedgenerator.py
django/utils/feedgenerator.py
+2
-2
functional.py
django/utils/functional.py
+1
-1
http.py
django/utils/http.py
+2
-2
text.py
django/utils/text.py
+1
-1
python3.txt
docs/topics/python3.txt
+4
-6
models.py
tests/base/models.py
+1
-1
tests.py
tests/basic/tests.py
+1
-1
tests.py
tests/defaultfilters/tests.py
+1
-1
tests.py
tests/httpwrappers/tests.py
+7
-7
tests.py
tests/i18n/tests.py
+1
-1
tests.py
tests/signing/tests.py
+2
-2
doctest_output.py
tests/test_utils/doctest_output.py
+1
-1
test_datastructures.py
tests/utils_tests/test_datastructures.py
+1
-1
test_http.py
tests/utils_tests/test_http.py
+2
-2
test_simplelazyobject.py
tests/utils_tests/test_simplelazyobject.py
+1
-1
No files found.
django/contrib/auth/management/__init__.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -142,7 +142,7 @@ def get_system_username():
# if there is no corresponding entry in the /etc/passwd file
# (a very restricted chroot environment, for example).
return
''
if
not
six
.
PY3
:
if
six
.
PY2
:
try
:
result
=
result
.
decode
(
DEFAULT_LOCALE_ENCODING
)
except
UnicodeDecodeError
:
...
...
django/contrib/auth/tests/test_basic.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -16,7 +16,7 @@ from django.test.signals import setting_changed
from
django.test.utils
import
override_settings
from
django.utils
import
translation
from
django.utils.encoding
import
force_str
from
django.utils.six
import
binary_type
,
PY
3
,
StringIO
from
django.utils.six
import
binary_type
,
PY
2
,
StringIO
@receiver
(
setting_changed
)
...
...
@@ -39,7 +39,7 @@ def mock_inputs(inputs):
class
mock_getpass
:
@staticmethod
def
getpass
(
prompt
=
b
'Password: '
,
stream
=
None
):
if
not
PY3
:
if
PY2
:
# getpass on Windows only supports prompt as bytestring (#19807)
assert
isinstance
(
prompt
,
binary_type
)
return
inputs
[
'password'
]
...
...
django/core/mail/message.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -366,7 +366,7 @@ class EmailMessage(object):
try
:
filename
.
encode
(
'ascii'
)
except
UnicodeEncodeError
:
if
not
six
.
PY3
:
if
six
.
PY2
:
filename
=
filename
.
encode
(
'utf-8'
)
filename
=
(
'utf-8'
,
''
,
filename
)
attachment
.
add_header
(
'Content-Disposition'
,
'attachment'
,
...
...
django/db/backends/mysql/base.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -420,7 +420,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
'conv'
:
django_conversions
,
'charset'
:
'utf8'
,
}
if
not
six
.
PY3
:
if
six
.
PY2
:
kwargs
[
'use_unicode'
]
=
True
settings_dict
=
self
.
settings_dict
if
settings_dict
[
'USER'
]:
...
...
django/db/backends/oracle/base.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -276,7 +276,7 @@ WHEN (new.%(col_name)s IS NULL)
# http://cx-oracle.sourceforge.net/html/cursor.html#Cursor.statement
# The DB API definition does not define this attribute.
statement
=
cursor
.
statement
if
statement
and
not
six
.
PY3
and
not
isinstance
(
statement
,
unicode
):
if
statement
and
six
.
PY2
and
not
isinstance
(
statement
,
unicode
):
statement
=
statement
.
decode
(
'utf-8'
)
# Unlike Psycopg's `query` and MySQLdb`'s `_last_executed`, CxOracle's
# `statement` doesn't contain the query parameters. refs #20010.
...
...
@@ -585,7 +585,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
cursor
.
execute
(
"SELECT 1 FROM DUAL WHERE DUMMY
%
s"
%
self
.
_standard_operators
[
'contains'
],
[
'X'
])
except
DatabaseError
:
except
DatabaseError
:
self
.
operators
=
self
.
_likec_operators
else
:
self
.
operators
=
self
.
_standard_operators
...
...
@@ -627,7 +627,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
and
x
.
code
==
2091
and
'ORA-02291'
in
x
.
message
:
six
.
reraise
(
utils
.
IntegrityError
,
utils
.
IntegrityError
(
*
tuple
(
e
.
args
)),
sys
.
exc_info
()[
2
])
raise
def
schema_editor
(
self
):
"Returns a new instance of this backend's SchemaEditor"
return
DatabaseSchemaEditor
(
self
)
...
...
django/db/backends/sqlite3/base.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -84,7 +84,7 @@ Database.register_converter(str("decimal"), decoder(util.typecast_decimal))
Database
.
register_adapter
(
datetime
.
datetime
,
adapt_datetime_with_timezone_support
)
Database
.
register_adapter
(
decimal
.
Decimal
,
util
.
rev_typecast_decimal
)
if
not
six
.
PY3
:
if
six
.
PY2
:
Database
.
register_adapter
(
str
,
lambda
s
:
s
.
decode
(
'utf-8'
))
Database
.
register_adapter
(
SafeBytes
,
lambda
s
:
s
.
decode
(
'utf-8'
))
...
...
django/db/models/base.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -264,7 +264,7 @@ class ModelBase(type):
return
new_class
new_class
.
_prepare
()
new_class
.
_meta
.
app_cache
.
register_models
(
new_class
.
_meta
.
app_label
,
new_class
)
# Because of the way imports happen (recursively), we may or may not be
# the first time this model tries to register with the framework. There
...
...
@@ -449,7 +449,7 @@ class Model(six.with_metaclass(ModelBase)):
return
force_str
(
'<
%
s:
%
s>'
%
(
self
.
__class__
.
__name__
,
u
))
def
__str__
(
self
):
if
not
six
.
PY3
and
hasattr
(
self
,
'__unicode__'
):
if
six
.
PY2
and
hasattr
(
self
,
'__unicode__'
):
if
type
(
self
)
.
__unicode__
==
Model
.
__str__
:
klass_name
=
type
(
self
)
.
__name__
raise
RuntimeError
(
"
%
s.__unicode__ is aliased to __str__. Did"
...
...
django/http/cookie.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -49,7 +49,7 @@ else:
if
not
_cookie_allows_colon_in_names
:
def
load
(
self
,
rawdata
):
self
.
bad_cookies
=
set
()
if
not
six
.
PY3
and
isinstance
(
rawdata
,
six
.
text_type
):
if
six
.
PY2
and
isinstance
(
rawdata
,
six
.
text_type
):
rawdata
=
force_str
(
rawdata
)
super
(
SimpleCookie
,
self
)
.
load
(
rawdata
)
for
key
in
self
.
bad_cookies
:
...
...
django/template/loaders/app_directories.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -15,7 +15,7 @@ from django.utils._os import safe_join
from
django.utils
import
six
# At compile time, cache the directories to search.
if
not
six
.
PY3
:
if
six
.
PY2
:
fs_encoding
=
sys
.
getfilesystemencoding
()
or
sys
.
getdefaultencoding
()
app_template_dirs
=
[]
for
app
in
settings
.
INSTALLED_APPS
:
...
...
@@ -25,7 +25,7 @@ for app in settings.INSTALLED_APPS:
raise
ImproperlyConfigured
(
'ImportError
%
s:
%
s'
%
(
app
,
e
.
args
[
0
]))
template_dir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
mod
.
__file__
),
'templates'
)
if
os
.
path
.
isdir
(
template_dir
):
if
not
six
.
PY3
:
if
six
.
PY2
:
template_dir
=
template_dir
.
decode
(
fs_encoding
)
app_template_dirs
.
append
(
template_dir
)
...
...
django/template/loaders/eggs.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -27,7 +27,7 @@ class Loader(BaseLoader):
resource
=
resource_string
(
app
,
pkg_name
)
except
Exception
:
continue
if
not
six
.
PY3
:
if
six
.
PY2
:
resource
=
resource
.
decode
(
settings
.
FILE_CHARSET
)
return
(
resource
,
'egg:
%
s:
%
s'
%
(
app
,
pkg_name
))
raise
TemplateDoesNotExist
(
template_name
)
django/utils/_os.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -12,7 +12,7 @@ except NameError:
class
WindowsError
(
Exception
):
pass
if
not
six
.
PY3
:
if
six
.
PY2
:
fs_encoding
=
sys
.
getfilesystemencoding
()
or
sys
.
getdefaultencoding
()
...
...
@@ -38,7 +38,7 @@ def upath(path):
"""
Always return a unicode path.
"""
if
not
six
.
PY3
and
not
isinstance
(
path
,
six
.
text_type
):
if
six
.
PY2
and
not
isinstance
(
path
,
six
.
text_type
):
return
path
.
decode
(
fs_encoding
)
return
path
...
...
@@ -47,7 +47,7 @@ def npath(path):
Always return a native path, that is unicode on Python 3 and bytestring on
Python 2.
"""
if
not
six
.
PY3
and
not
isinstance
(
path
,
bytes
):
if
six
.
PY2
and
not
isinstance
(
path
,
bytes
):
return
path
.
encode
(
fs_encoding
)
return
path
...
...
django/utils/encoding.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -30,7 +30,7 @@ def python_2_unicode_compatible(klass):
To support Python 2 and 3 with a single code base, define a __str__ method
returning text and apply this decorator to the class.
"""
if
not
six
.
PY3
:
if
six
.
PY2
:
klass
.
__unicode__
=
klass
.
__str__
klass
.
__str__
=
lambda
self
:
self
.
__unicode__
()
.
encode
(
'utf-8'
)
return
klass
...
...
django/utils/feedgenerator.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -46,7 +46,7 @@ def rfc2822_date(date):
dow
=
days
[
date
.
weekday
()]
month
=
months
[
date
.
month
-
1
]
time_str
=
date
.
strftime
(
'
%
s,
%%
d
%
s
%%
Y
%%
H:
%%
M:
%%
S '
%
(
dow
,
month
))
if
not
six
.
PY3
:
# strftime returns a byte string in Python 2
if
six
.
PY2
:
# strftime returns a byte string in Python 2
time_str
=
time_str
.
decode
(
'utf-8'
)
if
is_aware
(
date
):
offset
=
date
.
tzinfo
.
utcoffset
(
date
)
...
...
@@ -60,7 +60,7 @@ def rfc3339_date(date):
# Support datetime objects older than 1900
date
=
datetime_safe
.
new_datetime
(
date
)
time_str
=
date
.
strftime
(
'
%
Y-
%
m-
%
dT
%
H:
%
M:
%
S'
)
if
not
six
.
PY3
:
# strftime returns a byte string in Python 2
if
six
.
PY2
:
# strftime returns a byte string in Python 2
time_str
=
time_str
.
decode
(
'utf-8'
)
if
is_aware
(
date
):
offset
=
date
.
tzinfo
.
utcoffset
(
date
)
...
...
django/utils/functional.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -167,7 +167,7 @@ def lazy(func, *resultclasses):
return
hash
(
self
.
__cast
())
def
__mod__
(
self
,
rhs
):
if
self
.
_delegate_bytes
and
not
six
.
PY3
:
if
self
.
_delegate_bytes
and
six
.
PY2
:
return
bytes
(
self
)
%
rhs
elif
self
.
_delegate_text
:
return
six
.
text_type
(
self
)
%
rhs
...
...
django/utils/http.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -170,7 +170,7 @@ def base36_to_int(s):
value
=
int
(
s
,
36
)
# ... then do a final check that the value will fit into an int to avoid
# returning a long (#15067). The long type was removed in Python 3.
if
not
six
.
PY3
and
value
>
sys
.
maxint
:
if
six
.
PY2
and
value
>
sys
.
maxint
:
raise
ValueError
(
"Base36 input too large"
)
return
value
...
...
@@ -182,7 +182,7 @@ def int_to_base36(i):
factor
=
0
if
i
<
0
:
raise
ValueError
(
"Negative base36 conversion input."
)
if
not
six
.
PY3
:
if
six
.
PY2
:
if
not
isinstance
(
i
,
six
.
integer_types
):
raise
TypeError
(
"Non-integer base36 conversion input."
)
if
i
>
sys
.
maxint
:
...
...
django/utils/text.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -12,7 +12,7 @@ from django.utils.six.moves import html_entities
from
django.utils.translation
import
ugettext_lazy
,
ugettext
as
_
,
pgettext
from
django.utils.safestring
import
mark_safe
if
not
six
.
PY3
:
if
six
.
PY2
:
# Import force_unicode even though this module doesn't use it, because some
# people rely on it being here.
from
django.utils.encoding
import
force_unicode
...
...
docs/topics/python3.txt
Dosyayı görüntüle @
365c3e8b
...
...
@@ -376,15 +376,13 @@ explicitly tries both locations, as follows::
except ImportError: # Python 2
from urlparse import urlparse, urlunparse
PY
3
PY
2
~~~
If you need different code in Python 2 and Python 3, check :data:`six.PY
3
`::
If you need different code in Python 2 and Python 3, check :data:`six.PY
2
`::
if six.PY3:
# do stuff Python 3-wise
else:
# do stuff Python 2-wise
if six.PY2:
# compatibility code for Python 2
This is a last resort solution when :mod:`six` doesn't provide an appropriate
function.
...
...
tests/base/models.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -19,7 +19,7 @@ class MyModel(six.with_metaclass(CustomBaseModel, models.Model)):
# This is done to ensure that for Python2 only, defining metaclasses
# still does not fail to create the model.
if
not
six
.
PY3
:
if
six
.
PY2
:
class
MyModel
(
models
.
Model
):
"""Model subclass with a custom base using __metaclass__."""
__metaclass__
=
CustomBaseModel
tests/basic/tests.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -373,7 +373,7 @@ class ModelTest(TestCase):
"<Article: Third article>"
])
# Slicing works with longs (Python 2 only -- Python 3 doesn't have longs).
if
not
six
.
PY3
:
if
six
.
PY2
:
self
.
assertEqual
(
Article
.
objects
.
all
()[
long
(
0
)],
a
)
self
.
assertQuerysetEqual
(
Article
.
objects
.
all
()[
long
(
1
):
long
(
3
)],
[
"<Article: Second article>"
,
"<Article: Third article>"
])
...
...
tests/defaultfilters/tests.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -89,7 +89,7 @@ class DefaultFiltersTests(TestCase):
# The test above fails because of Python 2's float handling. Floats with
# many zeroes after the decimal point should be passed in as another type
# such as unicode or Decimal.
if
not
six
.
PY3
:
if
six
.
PY2
:
test_floatformat_py2_fail
=
unittest
.
expectedFailure
(
test_floatformat_py2_fail
)
...
...
tests/httpwrappers/tests.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -46,7 +46,7 @@ class QueryDictTests(unittest.TestCase):
def
test_immutable_basic_operations
(
self
):
q
=
QueryDict
(
str
(
''
))
self
.
assertEqual
(
q
.
getlist
(
'foo'
),
[])
if
not
six
.
PY3
:
if
six
.
PY2
:
self
.
assertEqual
(
q
.
has_key
(
'foo'
),
False
)
self
.
assertEqual
(
'foo'
in
q
,
False
)
self
.
assertEqual
(
list
(
six
.
iteritems
(
q
)),
[])
...
...
@@ -72,10 +72,10 @@ class QueryDictTests(unittest.TestCase):
self
.
assertRaises
(
AttributeError
,
q
.
setlist
,
'foo'
,
[
'bar'
])
self
.
assertRaises
(
AttributeError
,
q
.
appendlist
,
'foo'
,
[
'bar'
])
if
not
six
.
PY3
:
if
six
.
PY2
:
self
.
assertTrue
(
q
.
has_key
(
'foo'
))
self
.
assertTrue
(
'foo'
in
q
)
if
not
six
.
PY3
:
if
six
.
PY2
:
self
.
assertFalse
(
q
.
has_key
(
'bar'
))
self
.
assertFalse
(
'bar'
in
q
)
...
...
@@ -131,7 +131,7 @@ class QueryDictTests(unittest.TestCase):
q
.
appendlist
(
'foo'
,
'another'
)
self
.
assertEqual
(
q
.
getlist
(
'foo'
),
[
'bar'
,
'baz'
,
'another'
])
self
.
assertEqual
(
q
[
'foo'
],
'another'
)
if
not
six
.
PY3
:
if
six
.
PY2
:
self
.
assertTrue
(
q
.
has_key
(
'foo'
))
self
.
assertTrue
(
'foo'
in
q
)
...
...
@@ -176,10 +176,10 @@ class QueryDictTests(unittest.TestCase):
self
.
assertRaises
(
AttributeError
,
q
.
setlist
,
'foo'
,
[
'bar'
,
'baz'
])
self
.
assertRaises
(
AttributeError
,
q
.
appendlist
,
'foo'
,
[
'bar'
])
if
not
six
.
PY3
:
if
six
.
PY2
:
self
.
assertEqual
(
q
.
has_key
(
'vote'
),
True
)
self
.
assertEqual
(
'vote'
in
q
,
True
)
if
not
six
.
PY3
:
if
six
.
PY2
:
self
.
assertEqual
(
q
.
has_key
(
'foo'
),
False
)
self
.
assertEqual
(
'foo'
in
q
,
False
)
self
.
assertEqual
(
list
(
six
.
iteritems
(
q
)),
[(
'vote'
,
'no'
)])
...
...
@@ -195,7 +195,7 @@ class QueryDictTests(unittest.TestCase):
self
.
assertRaises
(
AttributeError
,
q
.
setdefault
,
'foo'
,
'bar'
)
self
.
assertRaises
(
AttributeError
,
q
.
__delitem__
,
'vote'
)
if
not
six
.
PY3
:
if
six
.
PY2
:
def
test_invalid_input_encoding
(
self
):
"""
QueryDicts must be able to handle invalid input encoding (in this
...
...
tests/i18n/tests.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -89,7 +89,7 @@ class TranslationTests(TransRealMixin, TestCase):
s4
=
ugettext_lazy
(
'Some other string'
)
self
.
assertEqual
(
False
,
s
==
s4
)
if
not
six
.
PY3
:
if
six
.
PY2
:
# On Python 2, gettext_lazy should not transform a bytestring to unicode
self
.
assertEqual
(
gettext_lazy
(
b
"test"
)
.
upper
(),
b
"TEST"
)
...
...
tests/signing/tests.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -48,7 +48,7 @@ class TestSigner(TestCase):
'jkw osanteuh ,rcuh nthu aou oauh ,ud du'
,
'
\u2019
'
,
]
if
not
six
.
PY3
:
if
six
.
PY2
:
examples
.
append
(
b
'a byte string'
)
for
example
in
examples
:
signed
=
signer
.
sign
(
example
)
...
...
@@ -79,7 +79,7 @@ class TestSigner(TestCase):
'a unicode string
\u2019
'
,
{
'a'
:
'dictionary'
},
]
if
not
six
.
PY3
:
if
six
.
PY2
:
objects
.
append
(
b
'a byte string'
)
for
o
in
objects
:
self
.
assertNotEqual
(
o
,
signing
.
dumps
(
o
))
...
...
tests/test_utils/doctest_output.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -59,7 +59,7 @@ __test__ = {"API_TEST": r"""
"""
}
if
not
six
.
PY3
:
if
six
.
PY2
:
__test__
[
"API_TEST"
]
+=
"""
>>> def produce_long():
... return 42L
...
...
tests/utils_tests/test_datastructures.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -49,7 +49,7 @@ class SortedDictTests(SimpleTestCase):
self
.
d2
[
7
]
=
'lucky number 7'
self
.
assertEqual
(
list
(
six
.
iterkeys
(
self
.
d2
)),
[
1
,
9
,
0
,
7
])
if
not
six
.
PY3
:
if
six
.
PY2
:
def
test_change_keys
(
self
):
"""
Changing the keys won't do anything, it's only a copy of the
...
...
tests/utils_tests/test_http.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -115,12 +115,12 @@ class TestUtilsHttp(unittest.TestCase):
# reciprocity works
for
n
in
[
0
,
1
,
1000
,
1000000
]:
self
.
assertEqual
(
n
,
http
.
base36_to_int
(
http
.
int_to_base36
(
n
)))
if
not
six
.
PY3
:
if
six
.
PY2
:
self
.
assertEqual
(
sys
.
maxint
,
http
.
base36_to_int
(
http
.
int_to_base36
(
sys
.
maxint
)))
# bad input
self
.
assertRaises
(
ValueError
,
http
.
int_to_base36
,
-
1
)
if
not
six
.
PY3
:
if
six
.
PY2
:
self
.
assertRaises
(
ValueError
,
http
.
int_to_base36
,
sys
.
maxint
+
1
)
for
n
in
[
'1'
,
'foo'
,
{
1
:
2
},
(
1
,
2
,
3
),
3.141
]:
self
.
assertRaises
(
TypeError
,
http
.
int_to_base36
,
n
)
...
...
tests/utils_tests/test_simplelazyobject.py
Dosyayı görüntüle @
365c3e8b
...
...
@@ -181,7 +181,7 @@ class TestUtilsSimpleLazyObject(TestCase):
pickled
=
pickle
.
dumps
(
x
,
1
)
pickled
=
pickle
.
dumps
(
x
,
2
)
if
not
six
.
PY3
:
if
six
.
PY2
:
import
cPickle
# This would fail with "TypeError: expected string or Unicode object, NoneType found".
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment