Skip to content

Commit 5f858c0

Browse files
Update stack levels
1 parent 6c24927 commit 5f858c0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Lib/_pydatetime.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,8 @@ def _parse_isoformat_time(tstr, is_expanded=False):
498498
warnings.warn(
499499
"Support for partially expanded formats are deprecated in "
500500
"accordance with ISO 8601:2 and will be removed in 3.15",
501-
DeprecationWarning
501+
DeprecationWarning,
502+
stacklevel=2,
502503
)
503504

504505
tz_comps = _parse_hh_mm_ss_ff(tzstr)

Modules/_datetimemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ parse_isoformat_time(const char *dtstr, size_t dtlen, int *hour, int *minute,
11351135
if (tzinfo_pos + 2 < p_end && tzinfo_pos[2] != ':' && strlen(tzinfo_pos) > 2) {
11361136
PyErr_WarnEx(PyExc_DeprecationWarning,
11371137
"Support for partially expanded formats is deprecated in "
1138-
"accordance with ISO 8601:2 and will be removed in 3.15", 1);
1138+
"accordance with ISO 8601:2 and will be removed in 3.15", 2);
11391139
}
11401140

11411141
rv = parse_hh_mm_ss_ff(tzinfo_pos, p_end, &tzhour, &tzminute, &tzsecond,

0 commit comments

Comments
 (0)