Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
return flat list from derived object's formulate() (#629)
The StdinDataRedirection command object was returning a list inside a list, which caused trouble when getting the "str()" of the command. Example: Python 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from plumbum.cmd import head >>> cmd = head['-2'] << "one\ntwo\nthree\nfour" >>> print(f"{cmd}") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python310\lib\site-packages\plumbum\commands\base.py", line 66, in __str__ return " ".join(self.formulate()) TypeError: sequence item 2: expected str instance, list found >>> Co-authored-by: Jason Singer (js731079) <[email protected]>
- Loading branch information