From bca20e28f6fa119155ae906b20886985ed71dfb3 Mon Sep 17 00:00:00 2001 From: Yoann Pietri Date: Mon, 30 Nov 2020 14:12:01 +0100 Subject: [PATCH] refactor: :art: Replace os.path by pathlib --- freeradius_utils/auth.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/freeradius_utils/auth.py b/freeradius_utils/auth.py index 1607ba05..5254c22f 100644 --- a/freeradius_utils/auth.py +++ b/freeradius_utils/auth.py @@ -40,7 +40,7 @@ from configparser import ConfigParser from re2oapi import Re2oAPIClient import sys -import os +from pathlib import Path import subprocess import logging import traceback @@ -114,10 +114,10 @@ def instantiate(*_): """ logger.info("Instantiation") - path = (os.path.dirname(os.path.abspath(__file__))) + path = Path(__file__).resolve(strict=True).parent config = ConfigParser() - config.read(path+'/config.ini') + config.read(path / 'config.ini') api_hostname = config.get('Re2o', 'hostname') api_password = config.get('Re2o', 'password')