mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-01-31 03:36:41 +03:00
fixing issue with AttributeError that has been replaced with objects.errors.Error
This commit is contained in:
parent
6567ee2b4d
commit
7c21f706e5
|
@ -8,6 +8,8 @@ from objects.providers import NewInstance
|
||||||
from objects.injections import InitArg
|
from objects.injections import InitArg
|
||||||
from objects.injections import Attribute
|
from objects.injections import Attribute
|
||||||
|
|
||||||
|
from objects.errors import Error
|
||||||
|
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,7 +74,7 @@ class Consumer(object):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.dependencies.database()
|
self.dependencies.database()
|
||||||
except AttributeError:
|
except Error:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
raise Exception('Database is not listed as a dependency')
|
raise Exception('Database is not listed as a dependency')
|
||||||
|
@ -98,7 +100,7 @@ def consumer_callback(dependencies=Catalog(Catalog.object_a,
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dependencies.database()
|
dependencies.database()
|
||||||
except AttributeError:
|
except Error:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
raise Exception('Database is not listed as a dependency')
|
raise Exception('Database is not listed as a dependency')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user