8000 Be more explicit when catching the exception when doing the pyparsing · matplotlib/matplotlib@8d88c7d · GitHub
[go: up one dir, main page]

Skip to content

Commit 8d88c7d

Browse files
committed
Be more explicit when catching the exception when doing the pyparsing
monkeypatch check.
1 parent eae31b1 commit 8d88c7d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/matplotlib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def compare_versions(a, b):
133133
f = pyparsing.Forward()
134134
f <<= pyparsing.Literal('a')
135135
bad_pyparsing = f is None
136-
except:
136+
except TypeError:
137137
bad_pyparsing = True
138138

139139
# pyparsing 1.5.6 does not have <<= on the Forward class, but

setupext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ def is_ok(self):
998998
f = pyparsing.Forward()
999999
f <<= pyparsing.Literal('a')
10001000
return f is not None
1001-
except:
1001+
except TypeError:
10021002
return False
10031003

10041004
def check(self):

0 commit comments

Comments
 (0)
0