Skip to content

Commit 1da5a3a

Browse files
committed
Correct line break
1 parent 9915dfe commit 1da5a3a

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed

Lib/test/datetimetester.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4537,8 +4537,7 @@ def utcoffset(self, t):
45374537

45384538
def test_valuerror_messages(self):
45394539
pattern = re.compile(
4540-
r"(hour|minute|second|microsecond) must "
4541-
r"be in \d+\.\.\d+, not \d+"
4540+
r"(hour|minute|second|microsecond) must be in \d+\.\.\d+, not \d+"
45424541
)
45434542
test_cases = [
45444543
(12, 30, 90, 9999991), # Microsecond out of range

Modules/_datetimemodule.c

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,7 @@ check_date_args(int year, int month, int day)
638638

639639
if (year < MINYEAR || year > MAXYEAR) {
640640
PyErr_Format(PyExc_ValueError,
641-
"year must be in %d..%d, not %d",
642-
MINYEAR, MAXYEAR, year);
641+
"year must be in %d..%d, not %d", MINYEAR, MAXYEAR, year);
643642
return -1;
644643
}
645644
if (month < 1 || month > 12) {
@@ -663,18 +662,15 @@ static int
663662
check_time_args(int h, int m, int s, int us, int fold)
664663
{
665664
if (h < 0 || h > 23) {
666-
PyErr_Format(PyExc_ValueError,
667-
"hour must be in 0..23, not %i", h);
665+
PyErr_Format(PyExc_ValueError, "hour must be in 0..23, not %i", h);
668666
return -1;
669667
}
670668
if (m < 0 || m > 59) {
671-
PyErr_Format(PyExc_ValueError,
672-
"minute must be in 0..59, not %i", m);
669+
PyErr_Format(PyExc_ValueError, "minute must be in 0..59, not %i", m);
673670
return -1;
674671
}
675672
if (s < 0 || s > 59) {
676-
PyErr_Format(PyExc_ValueError,
677-
"second must be in 0..59, not %i", s);
673+
PyErr_Format(PyExc_ValueError, "second must be in 0..59, not %i", s);
678674
return -1;
679675
}
680676
if (us < 0 || us > 999999) {
@@ -1438,8 +1434,7 @@ new_timezone(PyObject *offset, PyObject *name)
14381434
GET_TD_DAYS(offset) < -1 || GET_TD_DAYS(offset) >= 1) {
14391435
PyErr_Format(PyExc_ValueError, "offset must be a timedelta"
14401436
" strictly between -timedelta(hours=24) and"
1441-
" timedelta(hours=24),"
1442-
" not %R", offset);
1437+
" timedelta(hours=24), not %R", offset);
14431438
return NULL;
14441439
}
14451440

@@ -1510,8 +1505,7 @@ call_tzinfo_method(PyObject *tzinfo, const char *name, PyObject *tzinfoarg)
15101505
GET_TD_DAYS(offset) < -1 || GET_TD_DAYS(offset) >= 1) {
15111506
PyErr_Format(PyExc_ValueError, "offset must be a timedelta"
15121507
" strictly between -timedelta(hours=24) and"
1513-
" timedelta(hours=24),"
1514-
" not %R", offset);
1508+
" timedelta(hours=24), not %R", offset);
15151509
Py_DECREF(offset);
15161510
return NULL;
15171511
}
@@ -3392,8 +3386,7 @@ date_fromisocalendar(PyObject *cls, PyObject *args, PyObject *kw)
33923386

33933387
if (rv == -4) {
33943388
PyErr_Format(PyExc_ValueError,
3395-
"year must be in %d..%d, not %d",
3396-
MINYEAR, MAXYEAR, year);
3389+
"year must be in %d..%d, not %d", MINYEAR, MAXYEAR, year);
33973390
return NULL;
33983391
}
33993392

@@ -4389,8 +4382,7 @@ timezone_fromutc(PyDateTime_TimeZone *self, PyDateTime_DateTime *dt)
43894382
return NULL;
43904383
}
43914384
if (!HASTZINFO(dt) || dt->tzinfo != (PyObject *)self) {
4392-
PyErr_SetString(PyExc_ValueError, "fromutc: dt.tzinfo "
4393-
"is not self");
4385+
PyErr_SetString(PyExc_ValueError, "fromutc: dt.tzinfo is not self");
43944386
return NULL;
43954387
}
43964388

@@ -5364,8 +5356,7 @@ utc_to_seconds(int year, int month, int day,
53645356
/* ymd_to_ord() doesn't support year <= 0 */
53655357
if (year < MINYEAR || year > MAXYEAR) {
53665358
PyErr_Format(PyExc_ValueError,
5367-
"year must be in %d..%d, not %d",
5368-
MINYEAR, MAXYEAR, year);
5359+
"year must be in %d..%d, not %d", MINYEAR, MAXYEAR, year);
53695360
return -1;
53705361
}
53715362

0 commit comments

Comments
 (0)