mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
GH-116380: Revert move of pathlib globbing code to pathlib._glob
(#118678)
The previous change made the `glob` module slower to import, because it
imported `pathlib._glob` and hence the rest of `pathlib`.
Reverts a40f557d7b
.
This commit is contained in:
parent
ff6cbb2503
commit
b4bdf83cc6
4 changed files with 331 additions and 337 deletions
|
@ -5,6 +5,7 @@ import os
|
|||
import posixpath
|
||||
import sys
|
||||
import warnings
|
||||
from glob import _StringGlobber
|
||||
from itertools import chain
|
||||
from _collections_abc import Sequence
|
||||
|
||||
|
@ -18,7 +19,6 @@ except ImportError:
|
|||
grp = None
|
||||
|
||||
from ._abc import UnsupportedOperation, PurePathBase, PathBase
|
||||
from ._glob import StringGlobber
|
||||
|
||||
|
||||
__all__ = [
|
||||
|
@ -102,7 +102,7 @@ class PurePath(PurePathBase):
|
|||
'_hash',
|
||||
)
|
||||
parser = os.path
|
||||
_globber = StringGlobber
|
||||
_globber = _StringGlobber
|
||||
|
||||
def __new__(cls, *args, **kwargs):
|
||||
"""Construct a PurePath from one or several strings and or existing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue