Skip to content

Commit 95ddd55

Browse files
authored
Merge pull request #4 from RustPython/master
refresh
2 parents 0cd1ca5 + 61e752e commit 95ddd55

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1355
-263
lines changed

Cargo.lock

Lines changed: 100 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env_logger="0.5.10"
1818
clap = "2.31.2"
1919
rustpython_parser = {path = "parser"}
2020
rustpython_vm = {path = "vm"}
21-
rustyline = "2.1.0"
21+
rustyline = "4.1.0"
2222
xdg = "2.2.0"
2323

2424
[dev-dependencies.cpython]

Lib/os.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -133,34 +133,3 @@ def getenv(key, default=None):
133133
The optional second argument can specify an alternate default.
134134
key, default and the result are str."""
135135
return environ.get(key, default)
136-
137-
138-
def fspath(path):
139-
"""Return the path representation of a path-like object.
140-
141-
If str or bytes is passed in, it is returned unchanged. Otherwise the
142-
os.PathLike interface is used to get the path representation. If the
143-
path representation is not str or bytes, TypeError is raised. If the
144-
provided path is not str, bytes, or os.PathLike, TypeError is raised.
145-
"""
146-
if isinstance(path, (str, bytes)):
147-
return path
148-
149-
# Work from the object's type to match method resolution of other magic
150-
# methods.
151-
path_type = type(path)
152-
try:
153-
path_repr = path_type.__fspath__(path)
154-
except AttributeError:
155-
if hasattr(path_type, '__fspath__'):
156-
raise
157-
else:
158-
raise TypeError("expected str, bytes or os.PathLike object, "
159-
"not " + path_type.__name__)
160-
if isinstance(path_repr, (str, bytes)):
161-
return path_repr
162-
else:
163-
raise TypeError("expected {}.__fspath__() to return str or bytes, "
164-
"not {}".format(path_type.__name__,
165-
type(path_repr).__name__))
166-

0 commit comments

Comments
 (0)