Paul Moore added the comment:
is_dir is a *method*. To find out if an entry is a directory, you need to call
it.
So you need
from os import DirEntry, scandir
def test_is_dir():
for item in os.scandir(TEST_DIR):
if item.is_dir():
# ^^ note change
print(item.path)
return
TEST_DIR = '.'
test_is_dir()
----------
resolution: -> not a bug
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue28299>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com