django-rest-framework-bulk
django-rest-framework-bulk copied to clipboard
try/except/pass in __init__.py
Hi
Is this necessary?
I recently ran into a circular import issue where drf-bulk imports drf which in turn imports some of our code(via DEFAULT_PAGINATION_CLASS in DRF) and it hid the actual error which occurred deep inside our code.
the original intention is to be able to import useful modules directly from the package:
from rest_framework_bulk import ....
its not strictly necessary however I think it does not hurt. Not sure however about masking other exceptions. Can you give an example? If its a common error people can get, I could remove the try..except.
Any idea why this package would be catching syntax errors in other files?
The steps are as follows:
- Your code imports
rest_framework_bulk rest_framework_bulkimports DRF- DRF can import some other parts of your code as specified by
DEFAULT_PAGINATION_CLASSin the django setttings module.
This assumes that DRF(and replacement classes) have not been fully imported before rest_framework_bulk gets imported.
If during step 3, where DRF imports your code, there is any error it will be hidden due to the blanket exception handling in __init.py__