]> granicus.if.org Git - python/commitdiff
Fix 'check_metadata()' so it grovels through the distribution's metadata
authorGreg Ward <gward@python.net>
Fri, 21 Apr 2000 04:37:12 +0000 (04:37 +0000)
committerGreg Ward <gward@python.net>
Fri, 21 Apr 2000 04:37:12 +0000 (04:37 +0000)
object, rather than through the distribution itself (since I moved the meta-
data out to a DistributionMetadata instance).

Lib/distutils/command/sdist.py

index 59dd624813449a60eb2d851bb4601c12e33d5606..43007d597001e14baef64e3e9e3a6a82f5425834 100644 (file)
@@ -107,23 +107,23 @@ class sdist (Command):
 
     def check_metadata (self):
 
-        dist = self.distribution
+        metadata = self.distribution.metadata
 
         missing = []
         for attr in ('name', 'version', 'url'):
-            if not (hasattr (dist, attr) and getattr (dist, attr)):
+            if not (hasattr (metadata, attr) and getattr (metadata, attr)):
                 missing.append (attr)
 
         if missing:
             self.warn ("missing required meta-data: " +
                        string.join (missing, ", "))
 
-        if dist.author:
-            if not dist.author_email:
+        if metadata.author:
+            if not metadata.author_email:
                 self.warn ("missing meta-data: if 'author' supplied, " +
                            "'author_email' must be supplied too")
-        elif dist.maintainer:
-            if not dist.maintainer_email:
+        elif metadata.maintainer:
+            if not metadata.maintainer_email:
                 self.warn ("missing meta-data: if 'maintainer' supplied, " +
                            "'maintainer_email' must be supplied too")
         else: