Blame SOURCES/0001-test-fix-discovery-of-location.patch

f2d0b9
From d93e1563add8c40450556b7d74520439ee792bd9 Mon Sep 17 00:00:00 2001
f2d0b9
From: Pino Toscano <ptoscano@redhat.com>
f2d0b9
Date: Fri, 12 Oct 2018 12:50:18 +0200
f2d0b9
Subject: [PATCH] test: fix discovery of location
f2d0b9
f2d0b9
Use __file__ to detect the location of the script instead of sys.argv,
f2d0b9
so it will work also when loaded as module.
f2d0b9
---
f2d0b9
 test/test_augeas.py | 2 +-
f2d0b9
 1 file changed, 1 insertion(+), 1 deletion(-)
f2d0b9
f2d0b9
diff --git a/test/test_augeas.py b/test/test_augeas.py
f2d0b9
index 10edbe6..7474841 100644
f2d0b9
--- a/test/test_augeas.py
f2d0b9
+++ b/test/test_augeas.py
f2d0b9
@@ -4,7 +4,7 @@ import unittest
f2d0b9
 import sys
f2d0b9
 import os
f2d0b9
 
f2d0b9
-__mydir = os.path.dirname(sys.argv[0])
f2d0b9
+__mydir = os.path.dirname(os.path.abspath(__file__))
f2d0b9
 if not os.path.isdir(__mydir):
f2d0b9
     __mydir = os.getcwd()
f2d0b9
 
f2d0b9
-- 
f2d0b9
2.21.0
f2d0b9