Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Throw ImportError on import_string failure#969

Open
dcramer wants to merge 1 commit intomasterfrom
ref/throw-import-error
Open

Throw ImportError on import_string failure#969
dcramer wants to merge 1 commit intomasterfrom
ref/throw-import-error

Conversation

@dcramer
Copy link
Member

@dcramer dcramer commented Feb 26, 2017

No description provided.

try:
return getattr(module, class_name)
except AttributeError as ex:
raise ImportError(unicode(ex))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will NameError on python 3.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants