Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d318e21

Browse files
committed
Use CPython __new__ for Plural on PyPy 3.9.
PyPy 3.8 and earlier use __init__
1 parent dcfc4f3 commit d318e21

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

domdf_python_tools/words.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
.. versionadded:: 0.4.5
88
"""
99
#
10-
# Copyright © 2020 Dominic Davis-Foster <[email protected]>
10+
# Copyright © 2020-2022 Dominic Davis-Foster <[email protected]>
1111
#
1212
# Permission is hereby granted, free of charge, to any person obtaining a copy
1313
# of this software and associated documentation files (the "Software"), to deal
@@ -40,6 +40,7 @@
4040
import functools
4141
import random
4242
import re
43+
import sys
4344
from gettext import ngettext
4445
from reprlib import recursive_repr
4546
from string import ascii_lowercase, ascii_uppercase
@@ -601,7 +602,8 @@ def __call__(self, n: int) -> str: # type: ignore
601602
:param n:
602603
"""
603604

604-
if PYPY: # pragma: no cover (!PyPy)
605+
# if PYPY: # pragma: no cover (!PyPy)
606+
if PYPY and sys.version_info < (3, 9): # pragma: no cover (!PyPy)
605607

606608
def __init__(self, singular: str, plural: str):
607609
super().__init__(ngettext, singular, plural) # type: ignore[call-arg]

0 commit comments

Comments
 (0)