blob: 46d7ee68f26285db26b2640f2c07d6332380c756 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
tree b1261b79f5334e057317f1999caee9c162521097
parent 79a0fee082c6a8fac3dee5baf1f21669304e264d
parent 156f9074e19346d79d8d7bc21ff643f50ba6a954
author bors[bot] <26634292+bors[bot]@users.noreply.github.com> 1649011605 +0000
committer GitHub <noreply@github.com> 1649011605 +0000
gpgsig -----BEGIN PGP SIGNATURE-----
wsBcBAABCAAQBQJiSeuVCRBK7hj4Ov3rIwAABpoIAC2egobbzlkE0bT2gYJht3Vk
f9yWiCGl7J+P5U3GcoHQjliLRdSBbruJ5bEtMGETfDaa4P0D9JaQDQsOiE1sFrWO
IRADvK3f7VVWe7qvTcp5St0XLU7aV+ylcy1ebmQab2Iaq7xjhsJIA5o7hUQTD/BB
WEjEOSRY/U16JQXCQxW0XAAUekKRAH34jZ+P6/1ZBrEkvDb8rtgp334We5aU7dmV
oi7NMfdznArMFmSCYhe9RVpnk9D7wOMmhZ/T7WFAtyU7Wp+D7q0I14Au/1nhzVAd
r+ARgZ7TxiLn9IK7mTTmfEY7GejAP3XYxCDe/V23SbbITdAwlcehMcKeAl1eG8o=
=vFPx
-----END PGP SIGNATURE-----
Merge #11865
11865: Fix: Select correct insert position for disabled group import r=jonasbb a=jonasbb
The logic for importing with and without `group_imports` differed
significantly when no previous group existed. This lead to the problem
of using the wrong position when importing inside a module (#11585) or
when inner attributes are involved.
The existing code for grouped imports is better and takes these things
into account.
This PR changes the flow to use the pre-existing code for adding a new
import group even for the non-grouped import settings.
Some coverage markers are updated and the `group` is removed, since they
are now invoked in both cases (grouping and no grouping).
Tests are updated and two tests (empty module and inner attribute) are
added.
Fixes #11585
Co-authored-by: Jonas Bushart <jonas@bushart.org>
|