Skip to content

Commit

Permalink
Merge pull request #167 from zhaoblake/fix-compatibility-on-windows
Browse files Browse the repository at this point in the history
  • Loading branch information
greyli committed Dec 15, 2023
2 parents 2727263 + 081888d commit 62efd23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
name: tests name: tests
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macos-latest] # TODO: add windows-latest os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.8', '3.9', '3.10', '3.11', '3.12'] python: ['3.8', '3.9', '3.10', '3.11', '3.12']
fail-fast: false fail-fast: false
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions src/flask_assets.py
Expand Up @@ -275,6 +275,9 @@ def convert_item_to_flask_url(self, ctx, item, filepath=None):
else: else:
filename = rel_path filename = rel_path


# Windows compatibility
filename = filename.replace("\\", "/")

flask_ctx = None flask_ctx = None
if not has_request_context(): if not has_request_context():
flask_ctx = ctx.environment._app.test_request_context() flask_ctx = ctx.environment._app.test_request_context()
Expand Down

0 comments on commit 62efd23

Please sign in to comment.