Commits

Chris McDonough committed 3bb811f

dont require simplejson if we are using python >= 2.6

Comments (0)

Files changed (3)

 *.egg-info
 ez_setup
 *.egg-info
+*.egg
 test_logger.log
 from setuptools import setup, find_packages
-import sys, os
+import sys
 
 version = '0.10.2'
 
+install_requires = [
+    'WebOb',
+    'Tempita',
+    'Pygments',
+    'Paste>=1.7.1',
+    ]
+
+
+if sys.version_info[:2] < (2, 6):
+    install_requires.append('simplejson')
+
 setup(name='WebError',
       version=version,
       description="Web Error handling and exception catching",
       include_package_data=True,
       package_data = { 'weberror.evalexception': [ "*.html.tmpl", "media/*" ] },
       zip_safe=False,
-      install_requires=[
-        'WebOb', 'Tempita', 'Pygments', 'simplejson', 'Paste>=1.7.1'
-      ],
+      install_requires=install_requires,
       test_suite='nose.collector',
       tests_require=['nose', 'webtest', 'Paste'],
       entry_points="""

weberror/pdbcapture.py

 from webob import Request, Response
 import threading
 from paste.util import threadedprint
-from Queue import Queue
 from itertools import count
 import tempita
 from paste.urlparser import StaticURLParser
 from paste.util.filemixin import FileMixin
 import os
 import sys
-import simplejson
+
+try:
+    import json
+except ImportError: # pragma: no cover
+    import simplejson as json
 
 here = os.path.dirname(os.path.abspath(__file__))
 
         if not state['stdin_event'].isSet():
             body['stdinPending'] = 1
         resp = Response(content_type='application/json',
-                        body=simplejson.dumps(body))
+                        body=json.dumps(body))
         return resp
 
     def call_app(self, req, state):