Skip to content
Permalink
Browse files

Merge pull request #888 from charlesej/close-cursor-files

Close open cursor files
  • Loading branch information...
dlon committed Mar 8, 2019
2 parents 5b23090 + 7f1ad92 commit 811eaf051e86a4c711d42a0d426dfc138668f384
Showing with 13 additions and 4 deletions.
  1. +13 −4 src_py/cursors.py
@@ -255,10 +255,19 @@ def bitswap(num):
b = num&(1<<x) != 0
val = val<<1 | b
return val
if type(curs) is type(''): curs = open(curs)
if type(mask) is type(''): mask = open(mask)
curs = curs.readlines()
mask = mask.readlines()

if type(curs) is type(''):
with open(curs) as cursor_f:
curs = cursor_f.readlines()
else:
curs = curs.readlines()

if type(mask) is type(''):
with open(mask) as mask_f:
mask = mask_f.readlines()
else:
mask = mask.readlines()

#avoid comments
for line in range(len(curs)):
if curs[line].startswith("#define"):

0 comments on commit 811eaf0

Please sign in to comment.
You can’t perform that action at this time.