dcavalca / rpms / dnf

Forked from rpms/dnf 2 years ago
Clone

Blame SOURCES/0006-util-Correctly-source-errno.EEXIST.patch

14c88f
From 199fc9cb11ff004fc752b58b7177aaf8d7fcedfd Mon Sep 17 00:00:00 2001
14c88f
From: Neal Gompa <ngompa13@gmail.com>
14c88f
Date: Sat, 3 Mar 2018 12:44:54 -0500
14c88f
Subject: [PATCH] util: Correctly source errno.EEXIST
14c88f
14c88f
---
14c88f
 dnf/util.py | 3 ++-
14c88f
 1 file changed, 2 insertions(+), 1 deletion(-)
14c88f
14c88f
diff --git a/dnf/util.py b/dnf/util.py
14c88f
index ab7fd279..d0f1a4f2 100644
14c88f
--- a/dnf/util.py
14c88f
+++ b/dnf/util.py
14c88f
@@ -28,6 +28,7 @@ from functools import reduce
14c88f
 import dnf
14c88f
 import dnf.const
14c88f
 import dnf.pycomp
14c88f
+import errno
14c88f
 import itertools
14c88f
 import librepo
14c88f
 import locale
14c88f
@@ -120,7 +121,7 @@ def ensure_dir(dname):
14c88f
     try:
14c88f
         os.makedirs(dname, mode=0o755)
14c88f
     except OSError as e:
14c88f
-        if e.errno != os.errno.EEXIST or not os.path.isdir(dname):
14c88f
+        if e.errno != errno.EEXIST or not os.path.isdir(dname):
14c88f
             raise e
14c88f
 
14c88f
 def empty(iterable):
14c88f
-- 
14c88f
2.17.0
14c88f