davydany / sultan

Sultan: Command and Rule over your Shell
https://sultan.readthedocs.io/en/latest/
MIT License
680 stars 35 forks source link

Default value of tracecback in the constructor to be '' #55

Closed tminakov closed 6 years ago

tminakov commented 6 years ago

Currently the default value of traceback is None:

def __init__(self, stdout, stderr, traceback=None, rc=None):

And that value is only filled in if there is an exception in Sultan.run(); if the user unaware of that calls Result.print_traceback(), there's a general exception

TypeError: 'NoneType' object is not iterable

, coming from Result.__format_lines()'s iterator over the Result.traceback.

If the default is changed to an empty string, the exception won't occur and print_traceback() will behave like the other two print methods.

davydany commented 6 years ago

Wow, thank you for catching that. I'll review your both PRs within the next 2-3 days and get back to you.

tminakov commented 6 years ago

This one is not PRed :), yet it's a one-liner.

davydany commented 6 years ago

This is resolved. Please use Sultan==0.7.1