Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit383f9a7

Browse files
committed
fix(doc-tools): use sphinx.locale._ as gettext() for backward-compatibility in pyspecific.py
[why] spinix 5.3 changed locale.translators from a defaultdict(gettext.NullTranslations) to a dict, which leads to failure of pyspecific.py. Use sphinx.locale._ as gettext to fix the issue.
1 parentec1f6f5 commit383f9a7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎Doc/tools/extensions/pyspecific.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
fromsphinx.errorsimportNoUri
2727
exceptImportError:
2828
fromsphinx.environmentimportNoUri
29-
fromsphinx.localeimporttranslators
29+
fromsphinx.localeimport_assphinx_gettext
3030
fromsphinx.utilimportstatus_iterator,logging
3131
fromsphinx.util.nodesimportsplit_explicit_title
3232
fromsphinx.writers.textimportTextWriter,TextTranslator
@@ -104,7 +104,7 @@ class ImplementationDetail(Directive):
104104
defrun(self):
105105
self.assert_has_content()
106106
pnode=nodes.compound(classes=['impl-detail'])
107-
label=translators['sphinx'].gettext(self.label_text)
107+
label=sphinx_gettext(self.label_text)
108108
content=self.content
109109
add_text=nodes.strong(label,label)
110110
self.state.nested_parse(content,self.content_offset,pnode)
@@ -252,7 +252,7 @@ def run(self):
252252
else:
253253
args= []
254254

255-
label=translators['sphinx'].gettext(self._label[min(2,len(args))])
255+
label=sphinx_gettext(self._label[min(2,len(args))])
256256
text=label.format(name="``{}``".format(name),
257257
args=", ".join("``{}``".format(a)forainargsifa))
258258

@@ -431,7 +431,7 @@ def run(self):
431431
else:
432432
label=self._removed_label
433433

434-
label=translators['sphinx'].gettext(label)
434+
label=sphinx_gettext(label)
435435
text=label.format(deprecated=self.arguments[0],removed=self.arguments[1])
436436
iflen(self.arguments)==3:
437437
inodes,messages=self.state.inline_text(self.arguments[2],

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp