[gobject-introspection] utils: fix undefined cdir variable



commit c837a1d7dba5388b89d3b1b23139f0d4d2558893
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Sat Aug 11 17:10:50 2018 +0200

    utils: fix undefined cdir variable
    
    The docstring states that makedirs() was ported from python3, but
    this code part was missing. Found with newer pyflakes.

 giscanner/utils.py | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/giscanner/utils.py b/giscanner/utils.py
index f6cd0b4f..2feddab0 100644
--- a/giscanner/utils.py
+++ b/giscanner/utils.py
@@ -238,6 +238,9 @@ def makedirs(name, mode=0o777, exist_ok=False):
             # be happy if someone already created the path
             if e.errno != errno.EEXIST:
                 raise
+        cdir = os.path.curdir
+        if isinstance(tail, bytes):
+            cdir = os.path.curdir.encode("ascii")
         if tail == cdir:           # xxx/newdir/. exists if xxx/newdir exists
             return
     try:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]