Commit 4912f5a
Martin Lambertsen
fix: avoid using default mutable arguments
Using mutable default arguments is a common Python problem, see e.g.
https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments
In this specific case the default argument even tries to setup some
infrastructure settings at import time, which can potentially fail.
Note that this commit is changing the behavior for user passing in
`None` to the changed method, as it will now create an `AsyncClient`
with the options specified within the module. In the previous behavior
it would have raised an exception deeper down the call stack (see
http://github.com/microsoft/kiota-http-python/pull/383/files).1 parent a9de70b commit 4912f5a
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
0 commit comments