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

NoneType has no attribute split #96

Closed
odeits opened this issue May 3, 2016 · 2 comments
Closed

NoneType has no attribute split #96

odeits opened this issue May 3, 2016 · 2 comments

Comments

@odeits
Copy link

odeits commented May 3, 2016

cppclean version 0.9

Traceback (most recent call last):
  File "/usr/local/bin/cppclean", line 145, in <module>
    sys.exit(main())
  File "/usr/local/bin/cppclean", line 138, in main
    quiet=args.quiet):
  File "/usr/local/lib/python2.7/site-packages/cpp/static_data.py", line 117, in run
    _find_warnings(filename, lines, entire_ast, True) +
  File "/usr/local/lib/python2.7/site-packages/cpp/static_data.py", line 67, in _find_warnings
    find_static(node)
  File "/usr/local/lib/python2.7/site-packages/cpp/static_data.py", line 49, in find_static
    _find_warnings(filename, lines, body, False)
  File "/usr/local/lib/python2.7/site-packages/cpp/static_data.py", line 64, in _find_warnings
    print_warning(node)
  File "/usr/local/lib/python2.7/site-packages/cpp/static_data.py", line 31, in print_warning
    for name in node.name.split(','):
AttributeError: 'NoneType' object has no attribute 'split'
@odeits
Copy link
Author

odeits commented May 3, 2016

The piece of code that seems to cause the problem is

 struct Init {
    Init() { std::srand(static_cast<unsigned int>(std::time(0))); }
  } static init;

After applying a local fix to assist debugging this is the message i got
static data 'NONE'

Local fix for reference:

changed:

for name in node.name.split(','):

to:

        names =   node.name.split(',') if node.name is not None else ['NONE']
        for name in names:

@r-e-d
Copy link
Collaborator

r-e-d commented Jul 3, 2016

This should be fixed by the last patches.

@r-e-d r-e-d closed this as completed Jul 3, 2016
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