Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
timfel committed Mar 12, 2013
1 parent 894b610 commit e1910ee
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions targettopaz.py
Expand Up @@ -5,10 +5,12 @@

def target(driver, args):
driver.exe_name = "bin/topaz"
config = driver.config
config.translation.suggest(check_str_without_nul=True)
return entry_point, None


def jitpolicy(driver):
return JitPolicy()


def handle_config(config, translateconfig):
config.translation.suggest(check_str_without_nul=True)
2 changes: 1 addition & 1 deletion topaz/coerce.py
Expand Up @@ -49,7 +49,7 @@ def path(space, w_obj):
w_string = space.convert_type(w_obj, space.w_string, "to_path", raise_error=False)
if w_string is space.w_nil:
w_string = space.convert_type(w_obj, space.w_string, "to_str")
return space.str_w0(w_string)
return space.str0_w(w_string)

@staticmethod
def array(space, w_obj):
Expand Down
6 changes: 3 additions & 3 deletions topaz/modules/kernel.py
Expand Up @@ -166,13 +166,13 @@ def method_exec(self, space, args_w):
if space.respond_to(args_w[0], space.newsymbol("to_ary")):
w_cmd = space.convert_type(args_w[0], space.w_array, "to_ary")
cmd, argv0 = [
space.str_w0(space.convert_type(
space.str0_w(space.convert_type(
w_e, space.w_string, "to_str"
)) for w_e in space.listview(w_cmd)
]
else:
w_cmd = space.convert_type(args_w[0], space.w_string, "to_str")
cmd = space.str_w0(w_cmd)
cmd = space.str0_w(w_cmd)
argv0 = None

if len(args_w) > 1 or argv0 is not None:
Expand All @@ -184,7 +184,7 @@ def method_exec(self, space, args_w):
argv0 = cmd
args = [argv0]
args += [
space.str_w0(space.convert_type(
space.str0_w(space.convert_type(
w_arg, space.w_string, "to_str"
)) for w_arg in args_w[1:]
]
Expand Down
2 changes: 1 addition & 1 deletion topaz/objspace.py
Expand Up @@ -408,7 +408,7 @@ def str_w(self, w_obj):
"""Unpacks a string object as an rstr."""
return w_obj.str_w(self)

def str_w0(self, w_obj):
def str0_w(self, w_obj):
string = w_obj.str_w(self)
if "\x00" in string:
raise self.error(self.w_ArgumentError, "string contains null byte")
Expand Down

0 comments on commit e1910ee

Please sign in to comment.