# HG changeset patch
# User Bob Ippolito <bob@redivi.com>
# Date 1361298146 28800
#      Tue Feb 19 10:22:26 2013 -0800
# Node ID 42e9f52a7e6345a19574ac2778273eeedeacd8eb
# Parent  8b31b2a4d42cae3ca0fc633586e01120584a317a
Fix a Python 2.x compiler warning for narrow unicode builds (#56)

diff --git a/CHANGES.txt b/CHANGES.txt
--- 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
--- a/conf.py
+++ b/conf.py
@@ -44,7 +44,7 @@
 # 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
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@
     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
--- a/simplejson/__init__.py
+++ b/simplejson/__init__.py
@@ -99,7 +99,7 @@
     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
--- a/simplejson/_speedups.c
+++ b/simplejson/_speedups.c
@@ -486,11 +486,13 @@
                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;
     }
 }