Author: Brian Kearns <bdkea...@gmail.com> Branch: Changeset: r62050:ae243d6654b4 Date: 2013-03-04 23:09 -0500 http://bitbucket.org/pypy/pypy/changeset/ae243d6654b4/
Log: these are asserts upstream diff --git a/lib_pypy/datetime.py b/lib_pypy/datetime.py --- a/lib_pypy/datetime.py +++ b/lib_pypy/datetime.py @@ -61,17 +61,14 @@ def _days_before_month(year, month): "year, month -> number of days in year preceeding first day of month." - if not 1 <= month <= 12: - raise ValueError('month must be in 1..12', month) + assert 1 <= month <= 12, 'month must be in 1..12' return _DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year)) def _ymd2ord(year, month, day): "year, month, day -> ordinal, considering 01-Jan-0001 as day 1." - if not 1 <= month <= 12: - raise ValueError('month must be in 1..12', month) + assert 1 <= month <= 12, 'month must be in 1..12' dim = _days_in_month(year, month) - if not 1 <= day <= dim: - raise ValueError('day must be in 1..%d' % dim, day) + assert 1 <= day <= dim, ('day must be in 1..%d' % dim) return (_days_before_year(year) + _days_before_month(year, month) + day) _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit