summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2017-09-03 10:19:18 -0400
committerJason R. Coombs <jaraco@jaraco.com>2017-09-03 10:19:18 -0400
commit0389d408f92cb64f443abd15698a5925935d8b40 (patch)
treecfa33b92c41e022bc235a13842050cfa7f280268
parent289f7a28ad0b59e33cca1295ea6f1fb89583b2c4 (diff)
downloadsetuptools-scm-hotfix/issue-179.tar.gz
Refactor to detect for callability instead of string types, letting the duck type work for string parameters. Fixes #179.hotfix/issue-179
-rw-r--r--setuptools_scm/version.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/setuptools_scm/version.py b/setuptools_scm/version.py
index dce8c75..6c45638 100644
--- a/setuptools_scm/version.py
+++ b/setuptools_scm/version.py
@@ -22,13 +22,14 @@ def _warn_if_setuptools_outdated():
def callable_or_entrypoint(group, callable_or_name):
trace('ep', (group, callable_or_name))
- if isinstance(callable_or_name, str):
- for ep in iter_entry_points(group, callable_or_name):
- trace("ep found:", ep.name)
- return ep.load()
- else:
+
+ if callable(callable_or_name):
return callable_or_name
+ for ep in iter_entry_points(group, callable_or_name):
+ trace("ep found:", ep.name)
+ return ep.load()
+
def tag_to_version(tag):
trace('tag', tag)