Skip to content

Commit

Permalink
Call open() with string instead of Path, for 3.5
Browse files Browse the repository at this point in the history
Explicitly convert the `Path` object used for the `open()` call to a
string representation of the file path, for compatibility with Python
3.5.
  • Loading branch information
diego-plan9 committed Mar 9, 2019
1 parent 60ced97 commit 0dddd1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aiohttp_apispec/aiohttp_apispec.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def add_swagger_web_page(self, app: web.Application, static_path: str, view_path
static_files = Path(__file__).parent / "static"
app.router.add_static(static_path, static_files)

with open(static_files / "index.html") as swg_tmp:
with open(str(static_files / "index.html")) as swg_tmp:
tmp = Template(swg_tmp.read()).render(path=self.url, static=static_path)

async def swagger_view(_):
Expand Down

0 comments on commit 0dddd1a

Please sign in to comment.