Skip to content

Commit

Permalink
Use compat fspath instead of os.fspath
Browse files Browse the repository at this point in the history
When 7ba35c4 was cherry-picked it introduced the
usage of os.fspath which is not supported on
Python <3.6
  • Loading branch information
brettlangdon committed May 14, 2021
1 parent c04b0de commit 1f5b2a5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/flask/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ def static_folder(self):
@static_folder.setter
def static_folder(self, value):
if value is not None:
value = os.fspath(value).rstrip(r"\/")
value = fspath(value).rstrip(r"\/")
self._static_folder = value

@property
Expand Down
1 change: 0 additions & 1 deletion tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,6 @@ def test_static_url_empty_path_default(app):
rv.close()


@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires Python >= 3.6")
def test_static_folder_with_pathlib_path(app):
from pathlib import Path

Expand Down

0 comments on commit 1f5b2a5

Please sign in to comment.