Skip to content

Commit 9212a5a

Browse files
author
marat
committed
Docs formatting and code style
1 parent 0d53ced commit 9212a5a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Doc/library/datetime.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2766,10 +2766,11 @@ Notes:
27662766
for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``,
27672767
``%W``, and ``%V``. Format ``%y`` does require a leading zero.
27682768

2769-
When used with the :meth:`~.datetime.strftime` method, leading zeroes are included
2770-
by default for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``,
2771-
``%W``, ``%V`` and ``%y``. The ``%-`` flag (for example, ``%-d``) will produce
2772-
non-zero-padded output, except for ``%-y`` on Apple platforms and FreeBSD,
2769+
When used with the :meth:`~.datetime.strftime` method, leading zeroes
2770+
are included by default for formats ``%d``, ``%m``, ``%H``, ``%I``,
2771+
``%M``, ``%S``, ``%j``, ``%U``, ``%W``, ``%V`` and ``%y``.
2772+
The ``%-`` flag (for example, ``%-d``) will produce non-zero-padded
2773+
output, except for ``%-y`` on Apple platforms and FreeBSD,
27732774
which is still zero-padded.
27742775

27752776
(10)

Modules/_datetimemodule.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1960,7 +1960,6 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple,
19601960
i++;
19611961
/* A % has been seen and ch is the character after it. */
19621962
PyObject *replacement = NULL;
1963-
19641963
if (ch == 'z') {
19651964
/* %z -> +HHMM */
19661965
if (zreplacement == NULL) {
@@ -2104,8 +2103,8 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple,
21042103
Py_XDECREF(zreplacement);
21052104
Py_XDECREF(colonzreplacement);
21062105
Py_XDECREF(Zreplacement);
2107-
Py_XDECREF(strftime);
21082106
Py_XDECREF(dash_replacement);
2107+
Py_XDECREF(strftime);
21092108
return result;
21102109

21112110
Error:

0 commit comments

Comments
 (0)