Skip to content

Commit

Permalink
I prefer this style anyways
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Jul 18, 2013
1 parent 0b20593 commit 39bd50d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
3 changes: 1 addition & 2 deletions tasks/travis.py
Expand Up @@ -131,11 +131,10 @@ def run_docs_tests(env):
def run_flake8_tests(env):
# E124 closing bracket does not match visual indentation
# E125 continuation line does not distinguish itself from next logical line
# E126 continuation line over-indented for hanging indent
# E128 continuation line under-indented for visual indent
# E501 line too long
# F811 redefinition of unused
invoke.run('flake8 . --ignore="E124,E125,E126,E128,E501,F811"')
invoke.run('flake8 . --ignore="E124,E125,E128,E501,F811"')


TEST_TYPES = {
Expand Down
3 changes: 2 additions & 1 deletion topaz/objects/bignumobject.py
Expand Up @@ -169,6 +169,7 @@ def method_pow(self, space, w_other):
else:
raise space.error(
space.w_TypeError,
"%s can't be coerced into Bignum" %
"%s can't be coerced into Bignum" % (
space.obj_to_s(space.getclass(w_other))
)
)
21 changes: 11 additions & 10 deletions topaz/objects/stringobject.py
Expand Up @@ -633,8 +633,7 @@ def method_index(self, space, w_sub, offset=0):
else:
raise space.error(
space.w_TypeError,
"type mismatch: %s given" %
space.obj_to_s(space.getclass(w_sub))
"type mismatch: %s given" % space.obj_to_s(space.getclass(w_sub))
)

@classdef.method("rindex", end="int")
Expand All @@ -661,8 +660,7 @@ def method_rindex(self, space, w_sub, end=0):
else:
raise space.error(
space.w_TypeError,
"type mismatch: %s given" %
space.obj_to_s(space.getclass(w_sub))
"type mismatch: %s given" % space.obj_to_s(space.getclass(w_sub))
)
if idx < 0:
return space.w_nil
Expand Down Expand Up @@ -744,8 +742,9 @@ def method_split(self, space, w_sep=None, limit=0):
else:
raise space.error(
space.w_TypeError,
"wrong argument type %s (expected Regexp)" %
"wrong argument type %s (expected Regexp)" % (
space.obj_to_s(space.getclass(w_sep))
)
)

@classdef.method("swapcase!")
Expand Down Expand Up @@ -1040,8 +1039,9 @@ def method_scan(self, space, w_pattern, block):
else:
raise space.error(
space.w_TypeError,
"wrong argument type %s (expected Regexp)" %
"wrong argument type %s (expected Regexp)" % (
space.obj_to_s(space.getclass(w_pattern))
)
)
if block:
return self
Expand Down Expand Up @@ -1077,8 +1077,9 @@ def gsub_main(self, space, w_pattern, w_replacement, block, first_only):
else:
raise space.error(
space.w_TypeError,
"wrong argument type %s (expected Regexp)" %
"wrong argument type %s (expected Regexp)" % (
space.obj_to_s(space.getclass(w_replacement))
)
)

def gsub_regexp(self, space, w_pattern, replacement, w_hash, block, first_only):
Expand All @@ -1095,9 +1096,9 @@ def gsub_regexp(self, space, w_pattern, replacement, w_hash, block, first_only):
while pos < len(string) and self.search_context(space, ctx):
result += string[pos:ctx.match_start]
if replacement_parts is not None:
result += (self.gsub_regexp_subst_string(
space, replacement_parts, w_matchdata, pos
))
result += self.gsub_regexp_subst_string(
space, replacement_parts, w_matchdata, pos
)
elif replacement is not None:
result += replacement
elif block:
Expand Down

0 comments on commit 39bd50d

Please sign in to comment.