Skip to content

Commit

Permalink
Deal with too long directory names in write_json on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
pv committed Sep 27, 2015
1 parent d958e92 commit 77339dc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions asv/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,10 @@ def write_json(path, data, api_version=None):
Writes JSON to the given path, including indentation and sorting.
"""
path = os.path.abspath(path)
if not os.path.exists(os.path.dirname(path)):
os.makedirs(os.path.dirname(path))

dirname = long_path(os.path.dirname(path))
if not os.path.exists(dirname):
os.makedirs(dirname)

if api_version is not None:
data['version'] = api_version
Expand Down

0 comments on commit 77339dc

Please sign in to comment.