Skip to content

Commit 6b6e687

Browse files
authored
bpo-27425: Be more explicit in .gitattributes (pythonGH-840)
Updates checked-in line endings on several files.
1 parent 29fda8d commit 6b6e687

27 files changed

+2379
-2346
lines changed

.gitattributes

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,41 @@
1+
# Binary data types
2+
*.aif binary
3+
*.aifc binary
4+
*.aiff binary
5+
*.au binary
6+
*.bmp binary
7+
*.exe binary
8+
*.icns binary
9+
*.gif binary
10+
*.ico binary
11+
*.jpg binary
112
*.pck binary
2-
Lib/test/cjkencodings/* binary
3-
Lib/test/decimaltestdata/*.decTest binary
13+
*.png binary
14+
*.psd binary
15+
*.tar binary
16+
*.wav binary
17+
*.whl binary
18+
*.zip binary
19+
20+
# Specific binary files
421
Lib/test/sndhdrdata/sndhdr.* binary
5-
Lib/test/test_email/data/msg_26.txt binary
6-
Lib/test/xmltestdata/* binary
7-
Lib/venv/scripts/nt/* binary
8-
Lib/test/coding20731.py binary
22+
23+
# Text files that should not be subject to eol conversion
24+
Lib/test/cjkencodings/* -text
25+
Lib/test/decimaltestdata/*.decTest -text
26+
Lib/test/test_email/data/*.txt -text
27+
Lib/test/xmltestdata/* -text
28+
Lib/test/coding20731.py -text
29+
30+
# Special files in third party code
31+
Modules/zlib/zlib.map -text
32+
33+
# CRLF files
34+
*.bat text eol=crlf
35+
*.ps1 text eol=crlf
36+
*.sln text eol=crlf
37+
*.vcxproj* text eol=crlf
38+
*.props text eol=crlf
39+
*.proj text eol=crlf
40+
PCbuild/readme.txt text eol=crlf
41+
PC/readme.txt text eol=crlf

Lib/venv/scripts/nt/Activate.ps1

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
1-
function global:deactivate ([switch]$NonDestructive) {
2-
# Revert to original values
3-
if (Test-Path function:_OLD_VIRTUAL_PROMPT) {
4-
copy-item function:_OLD_VIRTUAL_PROMPT function:prompt
5-
remove-item function:_OLD_VIRTUAL_PROMPT
6-
}
7-
8-
if (Test-Path env:_OLD_VIRTUAL_PYTHONHOME) {
9-
copy-item env:_OLD_VIRTUAL_PYTHONHOME env:PYTHONHOME
10-
remove-item env:_OLD_VIRTUAL_PYTHONHOME
11-
}
12-
13-
if (Test-Path env:_OLD_VIRTUAL_PATH) {
14-
copy-item env:_OLD_VIRTUAL_PATH env:PATH
15-
remove-item env:_OLD_VIRTUAL_PATH
16-
}
17-
18-
if (Test-Path env:VIRTUAL_ENV) {
19-
remove-item env:VIRTUAL_ENV
20-
}
21-
22-
if (!$NonDestructive) {
23-
# Self destruct!
24-
remove-item function:deactivate
25-
}
26-
}
27-
28-
deactivate -nondestructive
29-
30-
$env:VIRTUAL_ENV="__VENV_DIR__"
31-
32-
if (! $env:VIRTUAL_ENV_DISABLE_PROMPT) {
33-
# Set the prompt to include the env name
34-
# Make sure _OLD_VIRTUAL_PROMPT is global
35-
function global:_OLD_VIRTUAL_PROMPT {""}
36-
copy-item function:prompt function:_OLD_VIRTUAL_PROMPT
37-
function global:prompt {
38-
Write-Host -NoNewline -ForegroundColor Green '__VENV_PROMPT__'
39-
_OLD_VIRTUAL_PROMPT
40-
}
41-
}
42-
43-
# Clear PYTHONHOME
44-
if (Test-Path env:PYTHONHOME) {
45-
copy-item env:PYTHONHOME env:_OLD_VIRTUAL_PYTHONHOME
46-
remove-item env:PYTHONHOME
47-
}
48-
49-
# Add the venv to the PATH
50-
copy-item env:PATH env:_OLD_VIRTUAL_PATH
51-
$env:PATH = "$env:VIRTUAL_ENV\__VENV_BIN_NAME__;$env:PATH"
1+
function global:deactivate ([switch]$NonDestructive) {
2+
# Revert to original values
3+
if (Test-Path function:_OLD_VIRTUAL_PROMPT) {
4+
copy-item function:_OLD_VIRTUAL_PROMPT function:prompt
5+
remove-item function:_OLD_VIRTUAL_PROMPT
6+
}
7+
8+
if (Test-Path env:_OLD_VIRTUAL_PYTHONHOME) {
9+
copy-item env:_OLD_VIRTUAL_PYTHONHOME env:PYTHONHOME
10+
remove-item env:_OLD_VIRTUAL_PYTHONHOME
11+
}
12+
13+
if (Test-Path env:_OLD_VIRTUAL_PATH) {
14+
copy-item env:_OLD_VIRTUAL_PATH env:PATH
15+
remove-item env:_OLD_VIRTUAL_PATH
16+
}
17+
18+
if (Test-Path env:VIRTUAL_ENV) {
19+
remove-item env:VIRTUAL_ENV
20+
}
21+
22+
if (!$NonDestructive) {
23+
# Self destruct!
24+
remove-item function:deactivate
25+
}
26+
}
27+
28+
deactivate -nondestructive
29+
30+
$env:VIRTUAL_ENV="__VENV_DIR__"
31+
32+
if (! $env:VIRTUAL_ENV_DISABLE_PROMPT) {
33+
# Set the prompt to include the env name
34+
# Make sure _OLD_VIRTUAL_PROMPT is global
35+
function global:_OLD_VIRTUAL_PROMPT {""}
36+
copy-item function:prompt function:_OLD_VIRTUAL_PROMPT
37+
function global:prompt {
38+
Write-Host -NoNewline -ForegroundColor Green '__VENV_PROMPT__'
39+
_OLD_VIRTUAL_PROMPT
40+
}
41+
}
42+
43+
# Clear PYTHONHOME
44+
if (Test-Path env:PYTHONHOME) {
45+
copy-item env:PYTHONHOME env:_OLD_VIRTUAL_PYTHONHOME
46+
remove-item env:PYTHONHOME
47+
}
48+
49+
# Add the venv to the PATH
50+
copy-item env:PATH env:_OLD_VIRTUAL_PATH
51+
$env:PATH = "$env:VIRTUAL_ENV\__VENV_BIN_NAME__;$env:PATH"

Lib/venv/scripts/nt/activate.bat

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
@echo off
2-
set "VIRTUAL_ENV=__VENV_DIR__"
3-
4-
if not defined PROMPT (
5-
set "PROMPT=$P$G"
6-
)
7-
8-
if defined _OLD_VIRTUAL_PROMPT (
9-
set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
10-
)
11-
12-
if defined _OLD_VIRTUAL_PYTHONHOME (
13-
set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
14-
)
15-
16-
set "_OLD_VIRTUAL_PROMPT=%PROMPT%"
17-
set "PROMPT=__VENV_PROMPT__%PROMPT%"
18-
19-
if defined PYTHONHOME (
20-
set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%"
21-
set PYTHONHOME=
22-
)
23-
24-
if defined _OLD_VIRTUAL_PATH (
25-
set "PATH=%_OLD_VIRTUAL_PATH%"
26-
) else (
27-
set "_OLD_VIRTUAL_PATH=%PATH%"
28-
)
29-
30-
set "PATH=%VIRTUAL_ENV%\__VENV_BIN_NAME__;%PATH%"
31-
32-
:END
1+
@echo off
2+
set "VIRTUAL_ENV=__VENV_DIR__"
3+
4+
if not defined PROMPT (
5+
set "PROMPT=$P$G"
6+
)
7+
8+
if defined _OLD_VIRTUAL_PROMPT (
9+
set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
10+
)
11+
12+
if defined _OLD_VIRTUAL_PYTHONHOME (
13+
set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
14+
)
15+
16+
set "_OLD_VIRTUAL_PROMPT=%PROMPT%"
17+
set "PROMPT=__VENV_PROMPT__%PROMPT%"
18+
19+
if defined PYTHONHOME (
20+
set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%"
21+
set PYTHONHOME=
22+
)
23+
24+
if defined _OLD_VIRTUAL_PATH (
25+
set "PATH=%_OLD_VIRTUAL_PATH%"
26+
) else (
27+
set "_OLD_VIRTUAL_PATH=%PATH%"
28+
)
29+
30+
set "PATH=%VIRTUAL_ENV%\__VENV_BIN_NAME__;%PATH%"
31+
32+
:END

Lib/venv/scripts/nt/deactivate.bat

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
@echo off
2-
3-
if defined _OLD_VIRTUAL_PROMPT (
4-
set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
5-
)
6-
set _OLD_VIRTUAL_PROMPT=
7-
8-
if defined _OLD_VIRTUAL_PYTHONHOME (
9-
set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
10-
set _OLD_VIRTUAL_PYTHONHOME=
11-
)
12-
13-
if defined _OLD_VIRTUAL_PATH (
14-
set "PATH=%_OLD_VIRTUAL_PATH%"
15-
)
16-
17-
set _OLD_VIRTUAL_PATH=
18-
19-
set VIRTUAL_ENV=
20-
21-
:END
1+
@echo off
2+
3+
if defined _OLD_VIRTUAL_PROMPT (
4+
set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
5+
)
6+
set _OLD_VIRTUAL_PROMPT=
7+
8+
if defined _OLD_VIRTUAL_PYTHONHOME (
9+
set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
10+
set _OLD_VIRTUAL_PYTHONHOME=
11+
)
12+
13+
if defined _OLD_VIRTUAL_PATH (
14+
set "PATH=%_OLD_VIRTUAL_PATH%"
15+
)
16+
17+
set _OLD_VIRTUAL_PATH=
18+
19+
set VIRTUAL_ENV=
20+
21+
:END

0 commit comments

Comments
 (0)