[Python-checkins] r56032 - sandbox/trunk/pep0/pep0/pep.py
brett.cannon
python-checkins at python.org
Tue Jun 19 03:46:35 CEST 2007
Author: brett.cannon
Date: Tue Jun 19 03:46:33 2007
New Revision: 56032
Modified:
sandbox/trunk/pep0/pep0/pep.py
Log:
Allow only Informational or Process PEPs to be Active.
Modified: sandbox/trunk/pep0/pep0/pep.py
==============================================================================
--- sandbox/trunk/pep0/pep0/pep.py (original)
+++ sandbox/trunk/pep0/pep0/pep.py Tue Jun 19 03:46:33 2007
@@ -29,7 +29,7 @@
"""
type_values = ("Standards Track", "Informational", "Process")
- # XXX Active PEPs can only be for Informational or Process PEPs.
+ # Active PEPs can only be for Informational or Process PEPs.
status_values = ("Accepted", "Rejected", "Withdrawn", "Deferred", "Final",
"Active", "Draft", "Replaced")
@@ -81,6 +81,11 @@
if status not in self.status_values:
raise ValueError("%r is not a valid Status value (PEP %s)" %
(status, self.number))
+ # Special case for Active PEPs.
+ if (status == "Active" and
+ self.type_ not in ("Process", "Informational")):
+ raise ValueError("Only Process and Informational PEPs may have an "
+ "Active status (PEP %s)" % self.number)
self.status = status
# 'Author'.
authors = self._parse_author(metadata_dict['Author'])
More information about the Python-checkins
mailing list