If you try to parse an expression that python-edtf doesn't like, it prints to stdout before throwing an exception. If this is an expected failure and you catch the exception, you're stuck with a noisy console.
>>> import edtf
>>> edtf.parse_edtf("[2011-05-01..2018-06-24]")
trying to Consecutives.__init__(**{'year': '2018', 'month': '06', 'day': '24', 'lower': ['2011', '-', '05', '-', '01'], 'upper': ['2018', '-', '06', '-', '24']})
...
The print statement here should be removed:
|
@classmethod |
|
def parse_action(cls, toks): |
|
kwargs = toks.asDict() |
|
try: |
|
return cls(**kwargs) # replace the token list with the class |
|
except Exception as e: |
|
print(f"trying to {cls.__name__}.__init__(**{kwargs})") |
|
raise e |
If you try to parse an expression that python-edtf doesn't like, it prints to stdout before throwing an exception. If this is an expected failure and you catch the exception, you're stuck with a noisy console.
The
printstatement here should be removed:python-edtf/edtf/parser/parser_classes.py
Lines 109 to 116 in cd67a9d