summaryrefslogtreecommitdiff
path: root/simplejson
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2013-02-19 10:22:26 -0800
committerBob Ippolito <bob@redivi.com>2013-02-19 10:22:26 -0800
commit7b96b85710439cdc7dac16a4655bf407bfad77d7 (patch)
tree1089bc9127c40a0cca804bf235c29a718e16924a /simplejson
parent9b595e53a0b491bcc62c69246fe4f1c0b338d9ae (diff)
downloadsimplejson-7b96b85710439cdc7dac16a4655bf407bfad77d7.tar.gz
Fix a Python 2.x compiler warning for narrow unicode builds (#56)v3.0.8
Diffstat (limited to 'simplejson')
-rw-r--r--simplejson/__init__.py2
-rw-r--r--simplejson/_speedups.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/simplejson/__init__.py b/simplejson/__init__.py
index 7e82827..2cba948 100644
--- a/simplejson/__init__.py
+++ b/simplejson/__init__.py
@@ -99,7 +99,7 @@ Using simplejson.tool from the shell to validate and pretty-print::
Expecting property name: line 1 column 2 (char 2)
"""
from __future__ import absolute_import
-__version__ = '3.0.7'
+__version__ = '3.0.8'
__all__ = [
'dump', 'dumps', 'load', 'loads',
'JSONDecoder', 'JSONDecodeError', 'JSONEncoder',
diff --git a/simplejson/_speedups.c b/simplejson/_speedups.c
index ae5b567..ae6044b 100644
--- a/simplejson/_speedups.c
+++ b/simplejson/_speedups.c
@@ -486,11 +486,13 @@ ascii_char_size(JSON_UNICHR c)
c == '\t') {
return 2;
}
- else if (c < 0x10000U) {
- return MIN_EXPANSION;
+#if defined(Py_UNICODE_WIDE) || PY_MAJOR_VERSION >= 3
+ else if (c >= 0x10000U) {
+ return 2 * MIN_EXPANSION;
}
+#endif
else {
- return 2 * MIN_EXPANSION;
+ return MIN_EXPANSION;
}
}