Closed frenzymadness closed 7 years ago
Yes, I forget to mention related issue in commit message but I can close it manually after merge.
The only thing that is changed by this fix is that 'PACKAGE WITHOUT SOURCES' appears at the end of Traceback instead of 'UNKNOWN'. It is not possible to generate the spec file without package sources. I suggest writing error message to stderr instead of log and raising SystemExit in both cases - url is None or set to 'UNKNOWN'.
Ok, I am gonna rearrange this part.
What is preferred way to print to stderr? I prefer to use print("error", file=sys.stderr)
but this brings dependency on future module for Python2. Another possibility is to use only sys.stderr.write("error\n")
.
The second option is used in pyp2rpm's sources several times already, so keep it consistent please.
I've made some changes as you suggested. Also, I created new parametrized test for testing exceptions in get_url function.
Reference #70 in the commit message?