65 |
67 |
66 readlink = os.readlink |
68 readlink = os.readlink |
67 unlink = os.unlink |
69 unlink = os.unlink |
68 rename = os.rename |
70 rename = os.rename |
69 removedirs = os.removedirs |
71 removedirs = os.removedirs |
|
72 |
|
73 if typing.TYPE_CHECKING: |
|
74 # Replace the various overloads that come along with aliasing stdlib methods |
|
75 # with the narrow definition that we care about in the type checking phase |
|
76 # only. This ensures that both Windows and POSIX see only the definition |
|
77 # that is actually available. |
|
78 # |
|
79 # Note that if we check pycompat.TYPE_CHECKING here, it is always False, and |
|
80 # the methods aren't replaced. |
|
81 |
|
82 def normpath(path: bytes) -> bytes: |
|
83 raise NotImplementedError |
|
84 |
|
85 def abspath(path: AnyStr) -> AnyStr: |
|
86 raise NotImplementedError |
|
87 |
|
88 def oslink(src: bytes, dst: bytes) -> None: |
|
89 raise NotImplementedError |
|
90 |
|
91 def readlink(path: bytes) -> bytes: |
|
92 raise NotImplementedError |
|
93 |
|
94 def unlink(path: bytes) -> None: |
|
95 raise NotImplementedError |
|
96 |
|
97 def rename(src: bytes, dst: bytes) -> None: |
|
98 raise NotImplementedError |
|
99 |
|
100 def removedirs(name: bytes) -> None: |
|
101 raise NotImplementedError |
|
102 |
|
103 |
70 expandglobs: bool = False |
104 expandglobs: bool = False |
71 |
105 |
72 umask: int = os.umask(0) |
106 umask: int = os.umask(0) |
73 os.umask(umask) |
107 os.umask(umask) |
74 |
108 |