Skip to content

Commit

Permalink
* handle undefined iteritems
Browse files Browse the repository at this point in the history
* fix str fmt
  • Loading branch information
DisposaBoy committed Feb 3, 2013
1 parent 3dd253d commit 3e6f1f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions gscomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

def snippet_match(ctx, m):
try:
for k,p in m.get('match', {}).iteritems():
for k,p in m.get('match', {}).items():
q = ctx.get(k, '')
if p and gs.is_a_string(p):
if not re.search(p, str(q)):
Expand All @@ -42,7 +42,7 @@ def resolve_snippets(ctx):
cl = set()
types = [''] if ctx.get('local') else ctx.get('types')
vars = {}
for k,v in ctx.iteritems():
for k,v in ctx.items():
if gs.is_a_string(v):
vars[k] = v

Expand Down
4 changes: 2 additions & 2 deletions gsdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ def cb(i, win):

def handle_pkgdirs_res(res):
m = {}
for root, dirs in res.iteritems():
for dir, fn in dirs.iteritems():
for root, dirs in res.items():
for dir, fn in dirs.items():
if not m.get(dir):
m[dir] = fn
ents = m.keys()
Expand Down
2 changes: 1 addition & 1 deletion mg9.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def f():
_check_changes()

if err:
gs.notice(DOMAIN, 'Cannot run get env vars: %s' % (MARGO_EXE, err))
gs.notice(DOMAIN, 'Cannot run get env vars: %s' % (err))
else:
env, err = gs.json_decode(out, {})
if err:
Expand Down

0 comments on commit 3e6f1f0

Please sign in to comment.