Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listdir里的ext_filters,传参报错 #10

Open
CGguocheng opened this issue Jun 3, 2019 · 1 comment
Open

listdir里的ext_filters,传参报错 #10

CGguocheng opened this issue Jun 3, 2019 · 1 comment

Comments

@CGguocheng
Copy link

result = (f for f in result if f.ext.lower() in ext_filters)
AttributeError: 'str' object has no attribute 'ext'

result为os.listdir的结果,类型为字符串,没有ext

@Wenfeng-Zhang
Copy link

Wenfeng-Zhang commented Mar 20, 2022

修改为:

        if ext_filters:
            result = (f for f in result if self.pathlib.isfile(self.child(f)) and DayuPath(f).ext.lower() in ext_filters)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants