File tree Expand file tree Collapse file tree 3 files changed +31
-10
lines changed
Expand file tree Collapse file tree 3 files changed +31
-10
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,15 @@ The release versions are PyPi releases.
33
44## Version 3.6 (as yet unreleased)
55
6+ #### Changes
7+ * import external `pathlib2` and `scandir` packages first if present
8+ (see [#462](../../issues/462))
9+
610#### New Features
711
812#### Fixes
913
14+
1015## [Version 3.5.5](https://pypi.python.org/pypi/pyfakefs/3.5.5)
1116
1217#### Fixes
Original file line number Diff line number Diff line change 88# Older versions might work ok, the versions chosen here are just the latest
99# available at the time of writing.
1010
11- pathlib2>=2.3.2
11+ pathlib2>=2.3.2;python_version<'3.4'
1212
13- scandir>=1.8
13+ scandir>=1.8;python_version<'3.5'
Original file line number Diff line number Diff line change 1+ # Licensed under the Apache License, Version 2.0 (the "License");
2+ # you may not use this file except in compliance with the License.
3+ # You may obtain a copy of the License at
4+ #
5+ # http://www.apache.org/licenses/LICENSE-2.0
6+ #
7+ # Unless required by applicable law or agreed to in writing, software
8+ # distributed under the License is distributed on an "AS IS" BASIS,
9+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+ # See the License for the specific language governing permissions and
11+ # limitations under the License.
12+
13+ """Imports external packages that replace or emulate internal packages.
14+ If the external module is not present, the build-in module is imported.
15+ """
16+
117try :
2- import pathlib
3- pathlib2 = None
18+ import pathlib2
19+ pathlib = None
420except ImportError :
521 try :
6- import pathlib2
7- pathlib = pathlib2
22+ import pathlib
23+ pathlib2 = None
824 except ImportError :
925 pathlib = None
1026 pathlib2 = None
1127
1228
1329try :
14- from os import scandir
30+ import scandir
1531 use_scandir = True
16- use_scandir_package = False
32+ use_scandir_package = True
1733except ImportError :
1834 try :
19- import scandir
35+ from os import scandir
2036 use_scandir = True
21- use_scandir_package = True
37+ use_scandir_package = False
2238 except ImportError :
2339 use_scandir = False
2440 use_scandir_package = False
You can’t perform that action at this time.
0 commit comments