aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3
diff options
context:
space:
mode:
Diffstat (limited to 'pygithub3')
-rw-r--r--pygithub3/core/errors.py6
-rw-r--r--pygithub3/core/utils.py5
-rw-r--r--pygithub3/requests/base.py6
-rw-r--r--pygithub3/resources/base.py5
4 files changed, 8 insertions, 14 deletions
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
diff --git a/pygithub3/requests/base.py b/pygithub3/requests/base.py
index d3e18a3..13472b0 100644
--- a/pygithub3/requests/base.py
+++ b/pygithub3/requests/base.py
@@ -2,15 +2,11 @@
# -*- encoding: utf-8 -*-
import re
-try:
- import simplejson as json
-except ImportError:
- import json
+from pygithub3.core.utils import import_module, json
from pygithub3.exceptions import (RequestDoesNotExist, UriInvalid,
ValidationError, InvalidBodySchema)
from pygithub3.resources.base import Raw
-from pygithub3.core.utils import import_module
ABS_IMPORT_PREFIX = 'pygithub3.requests'
diff --git a/pygithub3/resources/base.py b/pygithub3/resources/base.py
index 4ca2aa3..7045529 100644
--- a/pygithub3/resources/base.py
+++ b/pygithub3/resources/base.py
@@ -1,10 +1,7 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
-try:
- import simplejson as json
-except ImportError:
- import json
+from pygithub3.core.utils import json
class Resource(object):