From 9225d439ab46a7a05014949c961e477d5bb201d3 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 15 Jul 2020 21:58:24 +0200 Subject: [PATCH] object oriented path handling --- python/damask/_colormap.py | 1 + python/setup.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/python/damask/_colormap.py b/python/damask/_colormap.py index b95253189..73e7d0936 100644 --- a/python/damask/_colormap.py +++ b/python/damask/_colormap.py @@ -1,3 +1,4 @@ +import os import json import functools diff --git a/python/setup.py b/python/setup.py index a1b5ea166..798d8e4bf 100644 --- a/python/setup.py +++ b/python/setup.py @@ -1,8 +1,8 @@ import setuptools -import os +from pathlib import Path import re -with open(os.path.join(os.path.dirname(__file__),'damask/VERSION')) as f: +with open(Path(__file__).parent/'damask/VERSION') as f: version = re.sub(r'(-([^-]*)).*$',r'.\2',re.sub(r'^v(\d+\.\d+(\.\d+)?)',r'\1',f.readline().strip())) setuptools.setup(