Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33
Commit0a8b2c5
authored
upgrade_pythoncapi: try to preserve newlines when patching (#141)
In case we use \n on Windows or \r\n on Linux we don't wantpatching those files change every line due to newlines beingadjusted to the platform defaults.Instead pass 'newline=""' to all open() calls to preservenewlines. And when adding new lines use the first type ofnewline found in the file.The test changes make the patching code reuseable and addsa second test with multiple different newlines in the input.1 parent3082742 commit0a8b2c5
2 files changed
+55
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 46 | + | |
| 47 | + | |
69 | 48 | | |
70 | 49 | | |
71 | 50 | | |
72 | | - | |
| 51 | + | |
73 | 52 | | |
74 | 53 | | |
75 | 54 | | |
| |||
93 | 72 | | |
94 | 73 | | |
95 | 74 | | |
96 | | - | |
| 75 | + | |
97 | 76 | | |
98 | 77 | | |
99 | | - | |
| 78 | + | |
100 | 79 | | |
101 | 80 | | |
102 | 81 | | |
| |||
108 | 87 | | |
109 | 88 | | |
110 | 89 | | |
111 | | - | |
112 | 90 | | |
| 91 | + | |
113 | 92 | | |
114 | 93 | | |
115 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
116 | 117 | | |
117 | | - | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
120 | 137 | | |
121 | 138 | | |
122 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
557 | | - | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
558 | 562 | | |
559 | 563 | | |
560 | 564 | | |
561 | 565 | | |
562 | 566 | | |
563 | | - | |
| 567 | + | |
564 | 568 | | |
565 | 569 | | |
566 | 570 | | |
| |||
601 | 605 | | |
602 | 606 | | |
603 | 607 | | |
604 | | - | |
| 608 | + | |
605 | 609 | | |
606 | 610 | | |
607 | 611 | | |
| |||
620 | 624 | | |
621 | 625 | | |
622 | 626 | | |
623 | | - | |
| 627 | + | |
624 | 628 | | |
625 | 629 | | |
626 | 630 | | |
| |||
0 commit comments
Comments
(0)