Refactor main function

This commit is contained in:
Georgi Valkov 2011-08-23 16:48:08 +03:00
parent 51c8e53ffe
commit 5adcaa4385

View file

@ -2872,9 +2872,7 @@ def parseOpts():
return parser, opts, args return parser, opts, args
def main():
if __name__ == '__main__':
try:
parser, opts, args = parseOpts() parser, opts, args = parseOpts()
# Open appropriate CookieJar # Open appropriate CookieJar
@ -3046,6 +3044,10 @@ if __name__ == '__main__':
sys.exit(retcode) sys.exit(retcode)
if __name__ == '__main__':
try:
main()
except DownloadError: except DownloadError:
sys.exit(1) sys.exit(1)
except SameFileError: except SameFileError: