Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

dont require simplejson if we are using python >= 2.6

  • Loading branch information...
commit d495e926393f1c7304264569995ceb717ffefadd 1 parent c3e1b7c
Chris McDonough authored
1  .hgignore
@@ -7,4 +7,5 @@ syntax:glob
7 7
 *.egg-info
8 8
 ez_setup
9 9
 *.egg-info
  10
+*.egg
10 11
 test_logger.log
17  setup.py
... ...
@@ -1,8 +1,19 @@
1 1
 from setuptools import setup, find_packages
2  
-import sys, os
  2
+import sys
3 3
 
4 4
 version = '0.10.2'
5 5
 
  6
+install_requires = [
  7
+    'WebOb',
  8
+    'Tempita',
  9
+    'Pygments',
  10
+    'Paste>=1.7.1',
  11
+    ]
  12
+
  13
+
  14
+if sys.version_info[:2] < (2, 6):
  15
+    install_requires.append('simplejson')
  16
+
6 17
 setup(name='WebError',
7 18
       version=version,
8 19
       description="Web Error handling and exception catching",
@@ -29,9 +40,7 @@
29 40
       include_package_data=True,
30 41
       package_data = { 'weberror.evalexception': [ "*.html.tmpl", "media/*" ] },
31 42
       zip_safe=False,
32  
-      install_requires=[
33  
-        'WebOb', 'Tempita', 'Pygments', 'simplejson', 'Paste>=1.7.1'
34  
-      ],
  43
+      install_requires=install_requires,
35 44
       test_suite='nose.collector',
36 45
       tests_require=['nose', 'webtest', 'Paste'],
37 46
       entry_points="""
9  weberror/pdbcapture.py
... ...
@@ -1,14 +1,17 @@
1 1
 from webob import Request, Response
2 2
 import threading
3 3
 from paste.util import threadedprint
4  
-from Queue import Queue
5 4
 from itertools import count
6 5
 import tempita
7 6
 from paste.urlparser import StaticURLParser
8 7
 from paste.util.filemixin import FileMixin
9 8
 import os
10 9
 import sys
11  
-import simplejson
  10
+
  11
+try:
  12
+    import json
  13
+except ImportError: # pragma: no cover
  14
+    import simplejson as json
12 15
 
13 16
 here = os.path.dirname(os.path.abspath(__file__))
14 17
 
@@ -85,7 +88,7 @@ def internal_request(self, req):
85 88
         if not state['stdin_event'].isSet():
86 89
             body['stdinPending'] = 1
87 90
         resp = Response(content_type='application/json',
88  
-                        body=simplejson.dumps(body))
  91
+                        body=json.dumps(body))
89 92
         return resp
90 93
 
91 94
     def call_app(self, req, state):

0 notes on commit d495e92

Please sign in to comment.
Something went wrong with that request. Please try again.