Commits

Ada Young committed f4c6b23

Oops, now using try/except

Comments (0)

Files changed (1)

 
 	days = opts.days or 0
 
-	if type(days) is not type(0):
+	try:
+		days = int(days)
+	except ValueError:
 		print("Please specify an integer for -d parameter.")
 		parser.print_help()
 		exit(-1)
-	else:
-		days = int(days)
 
 	if opts.database is None:
 		print("You need to specify a database file\n")