Skip to content

Commit 21bafa3

Browse files
Resolve warnings of logger library (#5062)
Signed-off-by: Emmanuel Ferdman <[email protected]>
1 parent e9e350d commit 21bafa3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

bin/anthology/texmath.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,12 @@ def _parse_command(self, code, trg):
152152
pass
153153
# Give up, but preserve element
154154
else:
155-
log.warn(f"Unknown TeX-math command: {code}")
155+
log.warning(f"Unknown TeX-math command: {code}")
156156
self._append_unparsed(code, trg)
157157

158158
def _parse_fraction(self, args, trg):
159159
if len(args) != 2:
160-
log.warn(f"Couldn't parse \\frac: got {len(args)} arguments, expected 2")
160+
log.warning(f"Couldn't parse \\frac: got {len(args)} arguments, expected 2")
161161
self._append_unparsed({'name': 'frac', 'args': args}, trg)
162162
else:
163163
# Represent numerator of fraction as superscript
@@ -174,7 +174,7 @@ def _parse_fraction(self, args, trg):
174174
def _parse_text(self, code, trg):
175175
text = str(code)
176176
# TexSoup doesn't parse any non-alpha command as a command. Ex: \$
177-
# However it does seperate them into their own text part. Ex: 'r\\&dd' -> ['r', '\\&', 'dd']
177+
# However it does separate them into their own text part. Ex: 'r\\&dd' -> ['r', '\\&', 'dd']
178178
# Therefore try to do command mapping replacement of all text beginning with \ and of length 2
179179
if len(text) == 2 and text[0] == '\\':
180180
text = self.cmd_map.get(text[1], text)

python/acl_anthology/text/texmath.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ def _parse_command(self, code: TexCmd, trg: etree._Element) -> None:
168168
pass
169169
# Give up, but preserve element
170170
else:
171-
log.warn(f"Unknown TeX-math command: {code}")
171+
log.warning(f"Unknown TeX-math command: {code}")
172172
self._append_unparsed(code, trg)
173173

174174
def _parse_fraction(self, args: list[TexEverything], trg: etree._Element) -> None:
175175
if len(args) != 2:
176-
log.warn(f"Couldn't parse \\frac: got {len(args)} arguments, expected 2")
176+
log.warning(f"Couldn't parse \\frac: got {len(args)} arguments, expected 2")
177177
self._append_unparsed(TexCmd("frac", args=args), trg)
178178
else:
179179
# Represent numerator of fraction as superscript
@@ -190,7 +190,7 @@ def _parse_fraction(self, args: list[TexEverything], trg: etree._Element) -> Non
190190
def _parse_text(self, code: str | TexText, trg: etree._Element) -> SxscriptStatus:
191191
text = str(code)
192192
# TexSoup doesn't parse any non-alpha command as a command. Ex: \$
193-
# However it does seperate them into their own text part. Ex: 'r\\&dd' -> ['r', '\\&', 'dd']
193+
# However it does separate them into their own text part. Ex: 'r\\&dd' -> ['r', '\\&', 'dd']
194194
# Therefore try to do command mapping replacement of all text beginning with \ and of length 2
195195
if len(text) == 2 and text[0] == "\\":
196196
text = self.cmd_map.get(text[1], text)

0 commit comments

Comments
 (0)