From dd57b466efb0f49bc301b46be9ef9f2ffd7163d8 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Sun, 9 Jan 2022 14:23:11 -0500 Subject: [PATCH] Add static typing for utils.safeRelativePath --- src/diffuse/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/diffuse/utils.py b/src/diffuse/utils.py index 9d71012..1702435 100644 --- a/src/diffuse/utils.py +++ b/src/diffuse/utils.py @@ -28,6 +28,7 @@ from gettext import gettext as _ from typing import Final, List, Optional, TextIO from diffuse import constants +from diffuse.preferences import Preferences from diffuse.resources import theResources import gi # type: ignore @@ -143,7 +144,7 @@ def relpath(a: str, b: str) -> str: # helper function prevent files from being confused with command line options # by prepending './' to the basename -def safeRelativePath(abspath1, name, prefs, cygwin_pref): +def safeRelativePath(abspath1: str, name: str, prefs: Preferences, cygwin_pref: str) -> str: s = os.path.join(os.curdir, relpath(abspath1, os.path.abspath(name))) if isWindows(): if prefs.getBool(cygwin_pref):