From 3a82e76013624e931330e3726a22bf41088eb314 Mon Sep 17 00:00:00 2001 From: David Medina Date: Sat, 12 May 2012 17:28:52 +0200 Subject: Unify json imports --- pygithub3/core/errors.py | 6 +----- pygithub3/core/utils.py | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'pygithub3/core') diff --git a/pygithub3/core/errors.py b/pygithub3/core/errors.py index 4a95df0..9b84479 100644 --- a/pygithub3/core/errors.py +++ b/pygithub3/core/errors.py @@ -1,11 +1,7 @@ #!/usr/bin/env python # -*- encoding: utf-8 -*- -try: - import simplejson as json -except ImportError: - import json - +from pygithub3.core.utils import json from pygithub3.exceptions import NotFound, BadRequest, UnprocessableEntity diff --git a/pygithub3/core/utils.py b/pygithub3/core/utils.py index c6dbf0a..24a3bbf 100644 --- a/pygithub3/core/utils.py +++ b/pygithub3/core/utils.py @@ -2,6 +2,11 @@ # -*- encoding: utf-8 -*- """ Utils to support python 2.6 compatibility """ +try: + import simplejson as json +except ImportError: + import json + from collections import MutableMapping -- cgit v1.2.3-59-g8ed1b