Allow PrettyJson.py plugin to work in both ST2 and ST3

This commit is contained in:
Chris Castle 2013-02-22 23:12:15 -08:00
parent 7843edd433
commit d92e8bbe49
1 changed files with 9 additions and 2 deletions

View File

@ -1,9 +1,16 @@
import sublime
import sublime_plugin
import PrettyJSON.simplejson as json
from PrettyJSON.simplejson import OrderedDict
import decimal
try:
# python 3 / Sublime Text 3
from . import simplejson as json
from .simplejson import OrderedDict
except (ValueError):
# python 2 / Sublime Text 2
import simplejson as json
from simplejson import OrderedDict
s = sublime.load_settings("Pretty JSON.sublime-settings")