Commit 5eafe764 authored by Jason R. Coombs's avatar Jason R. Coombs

Prefer setdefault to hasattr/setattr

parent 17d7ac38
...@@ -267,8 +267,7 @@ class Distribution(_Distribution): ...@@ -267,8 +267,7 @@ class Distribution(_Distribution):
if attrs and 'setup_requires' in attrs: if attrs and 'setup_requires' in attrs:
self.fetch_build_eggs(attrs['setup_requires']) self.fetch_build_eggs(attrs['setup_requires'])
for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'): for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
if not hasattr(self,ep.name): vars(self).setdefault(ep.name, None)
setattr(self,ep.name,None)
_Distribution.__init__(self,attrs) _Distribution.__init__(self,attrs)
if isinstance(self.metadata.version, numbers.Number): if isinstance(self.metadata.version, numbers.Number):
# Some people apparently take "version number" too literally :) # Some people apparently take "version number" too literally :)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment