diff options
| author | bors <bors@rust-lang.org> | 2016-02-24 01:55:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-02-24 01:55:45 +0000 |
| commit | a4574bd4a5e92400ef700cf69cab420b490b377a (patch) | |
| tree | fe34ff54e1e085be44e4b86da4ddd6a587f06037 /src | |
| parent | 281f9d868fee8e4f9750fc12289dc10522f587ea (diff) | |
| parent | 622ec5d8d0f32977e0fb85f837b43c0570982121 (diff) | |
| download | rust-a4574bd4a5e92400ef700cf69cab420b490b377a.tar.gz rust-a4574bd4a5e92400ef700cf69cab420b490b377a.zip | |
Auto merge of #31855 - alexcrichton:fix-tidy, r=nikomatsakis
The MinGW-based Python implementations would automatically do this, but if we want to use Python from the official downloads our usage of `/` instead of `\` can wreak havoc. In a few select locations just use `os.path.normpath` do do the conversions properly for us.
Diffstat (limited to 'src')
| -rw-r--r-- | src/etc/licenseck.py | 4 | ||||
| -rw-r--r-- | src/etc/tidy.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/etc/licenseck.py b/src/etc/licenseck.py index 889b2c95a7e..aa2a00beae5 100644 --- a/src/etc/licenseck.py +++ b/src/etc/licenseck.py @@ -9,6 +9,7 @@ # except according to those terms. import re +import os license_re = re.compile( u"""(#|//) Copyright .* The Rust Project Developers. See the COPYRIGHT @@ -40,8 +41,9 @@ exceptions = [ ] def check_license(name, contents): + name = os.path.normpath(name) # Whitelist check - if any(name.endswith(e) for e in exceptions): + if any(name.endswith(os.path.normpath(e)) for e in exceptions): return True # Xfail check diff --git a/src/etc/tidy.py b/src/etc/tidy.py index ea34a803ccb..ce774d31b08 100644 --- a/src/etc/tidy.py +++ b/src/etc/tidy.py @@ -122,7 +122,8 @@ try: 'src/liblibc', } - if any(d in dirpath for d in skippable_dirs): + dirpath = os.path.normpath(dirpath) + if any(os.path.normpath(d) in dirpath for d in skippable_dirs): continue file_names = [os.path.join(dirpath, f) for f in filenames |
