[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyKDE] [PyQt4] bug in pyuic.py
From:       Jürgen_Urner <jUrner () arcor ! de>
Date:       2006-08-25 11:40:02
Message-ID: 44EEE192.5020102 () arcor ! de
[Download RAW message or body]


Hello all

This is probabbly alread known, but anyway.
There is a bug in pyuic.py, at least in PyQt-4.0.1 as I have it on my 
machine (win).

<snip>

def generateUi(uifname, pyfname, execute, indent):
    if pyfname == "-":
        pyfile = sys.stdout
    else:
        pyfile = file(pyfname, "w")

    uic.compileUi(uifname, pyfile, execute, indent)
    return 0

</snip>


## ...should make shure pyfile is closed if its not stdout
def generateUi(uifname, pyfname, execute, indent):
    is_stdout = True
    if pyfname == "-":
        pyfile = sys.stdout
    else:
        pyfile = file(pyfname, "w")
        is_stdout = False

    try:
        uic.compileUi(uifname, pyfile, execute, indent)
    finally:
       if not is_stdout:
          pyfile.close()
    return 0


Regards
   
    Juergen





_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic