Builtin os.listdir: fixed the unchecked result of the call to opendir(3).
authorPierre-Marie de Rodat <pmderodat@kawie.fr>
Thu, 8 Dec 2011 10:31:01 +0000 (11:31 +0100)
committerMark Dufour <mark.dufour@gmail.com>
Thu, 8 Dec 2011 19:33:28 +0000 (20:33 +0100)
commit788e6087edaec43dc807efde5e457cd34722dff2
treeeef20eb18422d91be2989c6e00f4adcc2bd7c6b1
parenta3f8f54590d4099c4ec66669296d5169a7f652ff
Builtin os.listdir: fixed the unchecked result of the call to opendir(3).

opendir can sometimes return 0 (if it cannot read the directory, because of
permissions or if the directory does not exist). When this happens, readdir(3)
must not be called, but an OSError must immediately be thrown.
shedskin/lib/os/__init__.cpp