Merge lp:~jameinel/bzr/2.1.0b1-no_win_warning into lp:bzr

Proposed by John A Meinel
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jameinel/bzr/2.1.0b1-no_win_warning
Merge into: lp:bzr
Diff against target: None lines
To merge this branch: bzr merge lp:~jameinel/bzr/2.1.0b1-no_win_warning
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+11869@code.launchpad.net
To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

fixes the permanent warning on Windows (because _readdir_pyx is never built there)

We'll still get a warning about _readdir_pyx when it is important (when trying to actually walk the filesystem.)

Revision history for this message
Martin Pool (mbp) wrote :

> fixes the permanent warning on Windows (because _readdir_pyx is never built
> there)
>
> We'll still get a warning about _readdir_pyx when it is important (when trying
> to actually walk the filesystem.)

Generally speaking if we expect it to be missing on some platforms we should have a check on flagging the absence, or perhaps for slight speed we should check the platform before even trying to import. But if that's unnecessary here, ok.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2009-09-16 07:47:47 +0000
3+++ NEWS 2009-09-16 11:59:14 +0000
4@@ -52,6 +52,9 @@
5 the partial packs created during the conversion not being consolidated
6 at the end of the conversion process. (Robert Collins, #423818)
7
8+* Don't give a warning on Windows when failing to import ``_readdir_pyx``
9+ as it is never built. (John Arbash Meinel, #430645)
10+
11 * Don't restrict the command name used to run the test suite.
12 (Vincent Ladeuil, #419950)
13
14
15=== modified file 'bzrlib/osutils.py'
16--- bzrlib/osutils.py 2009-09-11 06:39:56 +0000
17+++ bzrlib/osutils.py 2009-09-16 11:59:14 +0000
18@@ -1828,7 +1828,8 @@
19 from bzrlib._readdir_pyx import UTF8DirReader
20 file_kind_from_stat_mode = UTF8DirReader().kind_from_mode
21 except ImportError, e:
22- failed_to_load_extension(e)
23+ # This is one time where we won't warn that an extension failed to
24+ # load. The extension is never available on Windows anyway.
25 from bzrlib._readdir_py import (
26 _kind_from_mode as file_kind_from_stat_mode
27 )