Skip to content

Commit

Permalink
Restore Python 3.6 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Feb 20, 2021
1 parent e1b2543 commit 3c33945
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions jaraco/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import os
import re
import sys
import itertools
import functools
import calendar
Expand Down Expand Up @@ -319,3 +320,19 @@ def _(content: bytes, path):
@create.register # type: ignore[no-redef]
def _(content: str, path):
path.write_text(content)


if sys.version_info < (3, 7):

@create.register(dict) # type: ignore[no-redef]
def _(content, path):
path.mkdir(exist_ok=True)
build(content, prefix=path)

@create.register(bytes) # type: ignore[no-redef]
def _(content, path):
path.write_bytes(content)

@create.register(str) # type: ignore[no-redef]
def _(content, path):
path.write_text(content)

0 comments on commit 3c33945

Please sign in to comment.