Permalink
Browse files

dont require simplejson if we are using python >= 2.6

  • Loading branch information...
1 parent c3e1b7c commit d495e926393f1c7304264569995ceb717ffefadd @mcdonc mcdonc committed Nov 8, 2010
Showing with 20 additions and 7 deletions.
  1. +1 −0 .hgignore
  2. +13 −4 setup.py
  3. +6 −3 weberror/pdbcapture.py
View
@@ -7,4 +7,5 @@ syntax:glob
*.egg-info
ez_setup
*.egg-info
+*.egg
test_logger.log
View
@@ -1,8 +1,19 @@
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",
@@ -29,9 +40,7 @@
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="""
@@ -1,14 +1,17 @@
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__))
@@ -85,7 +88,7 @@ def internal_request(self, req):
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):

0 comments on commit d495e92

Please sign in to comment.