Skip to content

Commit

Permalink
[3.11] gh-104018: remove unused format "z" handling in string formatf…
Browse files Browse the repository at this point in the history
…loat() (GH-104107) (#104260)

gh-104018: remove unused format "z" handling in string formatfloat() (GH-104107)

This is a cleanup overlooked in PR GH-104033.
(cherry picked from commit 69621d1)

Co-authored-by: John Belmonte <john@neggie.net>
  • Loading branch information
miss-islington and belm0 committed May 7, 2023
1 parent efcd4bc commit 15ffcf7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 8 deletions.
2 changes: 0 additions & 2 deletions Include/internal/pycore_format.h
Expand Up @@ -14,14 +14,12 @@ extern "C" {
* F_BLANK ' '
* F_ALT '#'
* F_ZERO '0'
* F_NO_NEG_0 'z'
*/
#define F_LJUST (1<<0)
#define F_SIGN (1<<1)
#define F_BLANK (1<<2)
#define F_ALT (1<<3)
#define F_ZERO (1<<4)
#define F_NO_NEG_0 (1<<5)

#ifdef __cplusplus
}
Expand Down
3 changes: 0 additions & 3 deletions Objects/bytesobject.c
Expand Up @@ -430,9 +430,6 @@ formatfloat(PyObject *v, int flags, int prec, int type,
if (flags & F_ALT) {
dtoa_flags |= Py_DTSF_ALT;
}
if (flags & F_NO_NEG_0) {
dtoa_flags |= Py_DTSF_NO_NEG_0;
}
p = PyOS_double_to_string(x, type, prec, dtoa_flags, NULL);

if (p == NULL)
Expand Down
2 changes: 0 additions & 2 deletions Objects/unicodeobject.c
Expand Up @@ -14385,8 +14385,6 @@ formatfloat(PyObject *v, struct unicode_format_arg_t *arg,

if (arg->flags & F_ALT)
dtoa_flags |= Py_DTSF_ALT;
if (arg->flags & F_NO_NEG_0)
dtoa_flags |= Py_DTSF_NO_NEG_0;
p = PyOS_double_to_string(x, arg->ch, prec, dtoa_flags, NULL);
if (p == NULL)
return -1;
Expand Down
1 change: 0 additions & 1 deletion Python/ast_opt.c
Expand Up @@ -310,7 +310,6 @@ simple_format_arg_parse(PyObject *fmt, Py_ssize_t *ppos,
case ' ': *flags |= F_BLANK; continue;
case '#': *flags |= F_ALT; continue;
case '0': *flags |= F_ZERO; continue;
case 'z': *flags |= F_NO_NEG_0; continue;
}
break;
}
Expand Down

0 comments on commit 15ffcf7

Please sign in to comment.