summaryrefslogtreecommitdiff
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
parent9b595e53a0b491bcc62c69246fe4f1c0b338d9ae (diff)
downloadsimplejson-7b96b85710439cdc7dac16a4655bf407bfad77d7.tar.gz
Fix a Python 2.x compiler warning for narrow unicode builds (#56)v3.0.8
-rw-r--r--CHANGES.txt5
-rw-r--r--conf.py2
-rw-r--r--setup.py2
-rw-r--r--simplejson/__init__.py2
-rw-r--r--simplejson/_speedups.c8
5 files changed, 13 insertions, 6 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 8f0bcc1..c915fe3 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,8 @@
+Version 3.0.8 released 2013-02-19
+
+* Fix a Python 2.x compiler warning for narrow unicode builds
+ https://github.com/simplejson/simplejson/issues/56
+
Version 3.0.7 released 2013-01-11
* NOTE: this release only changes the license.
diff --git a/conf.py b/conf.py
index bdb35c5..2af3847 100644
--- a/conf.py
+++ b/conf.py
@@ -44,7 +44,7 @@ copyright = '2012, Bob Ippolito'
# The short X.Y version.
version = '3.0'
# The full version, including alpha/beta/rc tags.
-release = '3.0.7'
+release = '3.0.8'
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
diff --git a/setup.py b/setup.py
index 429c215..92412a0 100644
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@ from distutils.errors import CCompilerError, DistutilsExecError, \
DistutilsPlatformError
IS_PYPY = hasattr(sys, 'pypy_translation_info')
-VERSION = '3.0.7'
+VERSION = '3.0.8'
DESCRIPTION = "Simple, fast, extensible JSON encoder/decoder for Python"
with open('README.rst', 'r') as f:
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;
}
}