Skip to content
Permalink
Browse files

I prefer this style anyways

  • Loading branch information
alex committed Jul 18, 2013
1 parent 0b20593 commit 39bd50d68e5d97602724b3529a324a56bddc6957
Showing with 14 additions and 13 deletions.
  1. +1 −2 tasks/travis.py
  2. +2 −1 topaz/objects/bignumobject.py
  3. +11 −10 topaz/objects/stringobject.py
@@ -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 = {
@@ -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))
)
)
@@ -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")
@@ -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
@@ -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!")
@@ -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
@@ -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):
@@ -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:

0 comments on commit 39bd50d

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