ned14 / pcpp

A C99 preprocessor written in pure Python
Other
220 stars 41 forks source link

Error using "--time" without "-o" #32

Closed fondesa closed 4 years ago

fondesa commented 5 years ago

Python version: 3.7.4 pcpp version: 1.21

Description

When I try to print the time taken to to include each header without specifying an output file, it fails.

Command

pcpp first.hpp second.hpp --passthru-unfound-includes --time

Useful notes

Stacktrace:

Traceback (most recent call last):
  File "/usr/local/bin/pcpp", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/pcpp/pcmd.py", line 210, in main
    p = CmdPreprocessor(sys.argv)
  File "/usr/local/lib/python3.7/site-packages/pcpp/pcmd.py", line 120, in __init__
    print("\nTime report:")
ValueError: I/O operation on closed file.
ned14 commented 4 years ago

Fixed. Thanks for reporting this bug!