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

JarFile.class_count fails #1

Closed
SpaceManiac opened this issue Mar 16, 2013 · 0 comments
Closed

JarFile.class_count fails #1

SpaceManiac opened this issue Mar 16, 2013 · 0 comments
Assignees
Labels

Comments

@SpaceManiac
Copy link

JarFile.class_count attempts to take the len() of a generator object.

$ python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from jawa.jf import JarFile
>>> JarFile().class_count
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python27\lib\site-packages\jawa\jf.py", line 54, in class_count
    return len(p for p in self.namelist if p.endswith('.class'))
TypeError: object of type 'generator' has no len()

Suggestion: replace line 54 of jf.py with:
return len([p for p in self.namelist if p.endswith('.class')])

@ghost ghost assigned TkTech Mar 17, 2013
@TkTech TkTech closed this as completed in 61afb67 Mar 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants