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

Better handling of empty context/*.json files #26

Open
audreyfeldroy opened this issue Aug 9, 2013 · 0 comments
Open

Better handling of empty context/*.json files #26

audreyfeldroy opened this issue Aug 9, 2013 · 0 comments
Labels

Comments

@audreyfeldroy
Copy link
Owner

If a context json file is empty, you get:

Traceback (most recent call last):
  File "/home/travis/build/audreyr/complexity/tests/test_main.py", line 43, in test_conf_proj2_with_complexity
    main.complexity('tests/conf_proj2')
  File "/home/travis/build/audreyr/complexity/complexity/main.py", line 66, in complexity
    context = generate_context(context_dir)
  File "/home/travis/build/audreyr/complexity/complexity/generate.py", line 167, in generate_context
    obj = json.load(f)
  File "/usr/lib/python3.3/json/__init__.py", line 274, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/usr/lib/python3.3/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.3/json/decoder.py", line 352, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.3/json/decoder.py", line 370, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
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

1 participant