From a8fb12dcd42ad445e3003fd4b9d644f2837f1a7d Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Wed, 25 Nov 2015 14:40:49 +0200 Subject: [PATCH] Change scope of IS_PYPY and OBJECT_INIT constants in injections module to protected --- dependency_injector/injections.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dependency_injector/injections.py b/dependency_injector/injections.py index 31f11e33..553a2a8b 100644 --- a/dependency_injector/injections.py +++ b/dependency_injector/injections.py @@ -13,11 +13,11 @@ from .utils import is_kwarg_injection from .errors import Error -IS_PYPY = '__pypy__' in sys.builtin_module_names -if IS_PYPY or six.PY3: # pragma: no cover - OBJECT_INIT = six.get_unbound_function(object.__init__) +_IS_PYPY = '__pypy__' in sys.builtin_module_names +if _IS_PYPY or six.PY3: # pragma: no cover + _OBJECT_INIT = six.get_unbound_function(object.__init__) else: # pragma: no cover - OBJECT_INIT = None + _OBJECT_INIT = None class Injection(object): @@ -150,7 +150,7 @@ def inject(*args, **kwargs): cls = callback_or_cls try: cls_init = six.get_unbound_function(cls.__init__) - assert cls_init is not OBJECT_INIT + assert cls_init is not _OBJECT_INIT except (AttributeError, AssertionError): raise Error( 'Class {0}.{1} has no __init__() '.format(cls.__module__,