Commit 1a6f9f2
committed
Handle None entries in sys.modules.
sys.modules entries can be explicitly set to None to block imports, so
the `name in sys.modules` check should rather be written
`sys.modules.get(name)` (... is not None).
While we're at it, disentangle a bit install_repl_displayhook to exit
early if `not sys.modules.get("IPython") or not get_ipython()`, which
avoids having to throw a local NotIPython exception just to `goto end`.
(Also note that the import of `backend2gui` should not throw an
ImportError, as that mapping has been around since <2011).1 parent 69edfa2 commit 1a6f9f2
File tree
4 files changed
+44
-51
lines changed- lib/matplotlib
- backends
- cbook
- testing
4 files changed
+44
-51
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | | - | |
| 43 | + | |
42 | 44 | | |
43 | | - | |
| 45 | + | |
44 | 46 | | |
45 | | - | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
79 | | - | |
80 | | - | |
81 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
150 | 135 | | |
151 | | - | |
152 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
153 | 139 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
159 | 146 | | |
160 | | - | |
161 | | - | |
162 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
163 | 152 | | |
164 | 153 | | |
165 | 154 | | |
166 | 155 | | |
167 | | - | |
| 156 | + | |
168 | 157 | | |
169 | 158 | | |
170 | 159 | | |
| |||
174 | 163 | | |
175 | 164 | | |
176 | 165 | | |
177 | | - | |
178 | | - | |
| 166 | + | |
| 167 | + | |
179 | 168 | | |
180 | 169 | | |
181 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
0 commit comments