Created
August 12, 2014 00:34
-
-
Save psykzz/c482667c1f6ef6405c96 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Speeds up helper to promote 3rd parties""" | |
| from __future__ import print_function | |
| """ JSON replacement | |
| Load order: | |
| > ujson | |
| > yajl | |
| > simplejson | |
| > jsonlib2 | |
| > std json | |
| """ | |
| __all__ = ['json'] | |
| try: | |
| import ujson as json | |
| except ImportError: | |
| try: | |
| import yajl as json | |
| except ImportError: | |
| try: | |
| import simplejson as json | |
| except ImportError: | |
| try: | |
| import jsonlib2 as json | |
| except ImportError: | |
| import json | |
| print("Didn't load any replacement json modules, considering install some to speed up your application.\npip install ujson") | |
| # we are using regular python standard json | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment