Skip to content

Commit

Permalink
Refs tancredi#17 Finishing flake8 alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
gmaciascorrea committed May 9, 2022
1 parent 611b8c5 commit 86548be
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion snake/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import graphics
import theme
import gameloop
Expand All @@ -23,4 +22,5 @@ def run():
except KeyboardInterrupt:
exit()


run()
8 changes: 5 additions & 3 deletions snake/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def ioctl_gwinsz(fd):
'hh',
fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234')
)
except:
return
except Exception as e:
return e
return cr

cr = ioctl_gwinsz(0) or ioctl_gwinsz(1) or ioctl_gwinsz(2)
Expand All @@ -23,7 +23,9 @@ def ioctl_gwinsz(fd):
fd = os.open(os.ctermid(), os.O_RDONLY)
cr = ioctl_gwinsz(fd)
os.close(fd)
except:
except Exception as e:
error = e.message
print(error)
pass
if not cr:
cr = (env.get('LINES', 25), env.get('COLUMNS', 80))
Expand Down
2 changes: 1 addition & 1 deletion snake/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def draw_score():

def draw_lives():
posx = (-stage.width / 2) + 3
for x in xrange(1, game.lives + 1):
for x in range(1, game.lives + 1):
posx += 1
draw_tile(
posx,
Expand Down
2 changes: 1 addition & 1 deletion snake/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def exit():
graphics.exit()
print 'Come back soon!'
print('Come back soon!')


def run():
Expand Down

0 comments on commit 86548be

Please sign in to comment.