You probably want 
```
if any(x not in string.printable for x in line):
```