Update pwrball.py - handle excpetion when avoid.cvs file does not exist.
This commit is contained in:
parent
a5efb9a553
commit
b3b7c15fc2
@ -35,6 +35,8 @@ def main():
|
||||
logging.basicConfig(level=logging.INFO, format = "[%(levelname)s] (%(threadName)-10s) %(message)s",)
|
||||
|
||||
avoid = []
|
||||
|
||||
try:
|
||||
with open("avoid.csv", "r") as f:
|
||||
reader = csv.reader(f)
|
||||
for row in reader:
|
||||
@ -42,6 +44,8 @@ def main():
|
||||
for num in row:
|
||||
introw.append(int(num))
|
||||
avoid.append(introw)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
for item in avoid:
|
||||
logging.debug("before: %s", item)
|
||||
|
Loading…
x
Reference in New Issue
Block a user