diff --git a/topaz/ast.py b/topaz/ast.py index 50d3ead13..5002668bf 100644 --- a/topaz/ast.py +++ b/topaz/ast.py @@ -287,6 +287,7 @@ def compile(self, ctx): ctx.emit(consts.LOAD_SINGLETON_CLASS) self.compile_body(ctx, "singletonclass") + class Module(BaseModule): def compile(self, ctx): if self.scope is not None: diff --git a/topaz/objects/arrayobject.py b/topaz/objects/arrayobject.py index 0654e1e6d..d6f4e2d2e 100644 --- a/topaz/objects/arrayobject.py +++ b/topaz/objects/arrayobject.py @@ -337,9 +337,9 @@ def method_insert(self, space, i, args_w): return self if i < 0: if i < -length - 1: - raise space.error(space.w_IndexError, - "index %d too small for array; minimum: %d" % (i + 1, -length) - ) + raise space.error(space.w_IndexError, + "index %d too small for array; minimum: %d" % (i + 1, -length) + ) i += length + 1 assert i >= 0 for w_e in args_w: diff --git a/topaz/objects/fileobject.py b/topaz/objects/fileobject.py index 1882711ee..4fc5c7ec9 100644 --- a/topaz/objects/fileobject.py +++ b/topaz/objects/fileobject.py @@ -1,5 +1,4 @@ import os -import sys import stat from topaz.coerce import Coerce @@ -9,7 +8,6 @@ from topaz.objects.hashobject import W_HashObject from topaz.objects.objectobject import W_Object from topaz.objects.ioobject import W_IOObject -from topaz.objects.stringobject import W_StringObject from topaz.system import IS_WINDOWS from topaz.utils.ll_file import O_BINARY, ftruncate, isdir, fchmod from topaz.utils.filemode import map_filemode diff --git a/topaz/objects/rangeobject.py b/topaz/objects/rangeobject.py index 47d86d2a7..ebb86984a 100644 --- a/topaz/objects/rangeobject.py +++ b/topaz/objects/rangeobject.py @@ -22,12 +22,12 @@ def method_initialize(self, space, w_start, w_end, excl=False): if self.w_start is not None or self.w_end is not None: raise space.error(space.w_NameError, "`initialize' called twice") if space.send(w_start, space.newsymbol("<=>"), [w_end]) is space.w_nil: - raise space.error(space.w_ArgumentError, "bad value for range" ) + raise space.error(space.w_ArgumentError, "bad value for range") self.w_start = w_start self.w_end = w_end self.exclusive = excl - + @classdef.method("begin") def method_begin(self, space): return self.w_start diff --git a/topaz/utils/filemode.py b/topaz/utils/filemode.py index 983e875c2..f3c1f9a75 100644 --- a/topaz/utils/filemode.py +++ b/topaz/utils/filemode.py @@ -1,5 +1,4 @@ import os -import sys from topaz.objects.stringobject import W_StringObject from topaz.utils.ll_file import O_BINARY diff --git a/topaz/utils/ll_dir.py b/topaz/utils/ll_dir.py index 5ae2c80e1..c69eba8af 100644 --- a/topaz/utils/ll_dir.py +++ b/topaz/utils/ll_dir.py @@ -1,5 +1,3 @@ -import sys - from rpython.rlib import rposix from rpython.rtyper.lltypesystem import rffi, lltype from rpython.rtyper.tool import rffi_platform as platform diff --git a/topaz/utils/ll_file.py b/topaz/utils/ll_file.py index 402ffe9f7..bd0a33141 100755 --- a/topaz/utils/ll_file.py +++ b/topaz/utils/ll_file.py @@ -1,6 +1,4 @@ import os -import stat -import sys from rpython.rtyper.lltypesystem import rffi from rpython.rtyper.tool import rffi_platform as platform @@ -12,12 +10,13 @@ if IS_WINDOWS: O_BINARY = os.O_BINARY - eci = ExternalCompilationInfo(includes=['windows.h']) + eci = ExternalCompilationInfo(includes=["windows.h"]) + class CConfig: _compilation_info_ = eci config = platform.configure(CConfig) - _chsize = rffi.llexternal('_chsize', + _chsize = rffi.llexternal("_chsize", [rffi.INT, rffi.LONG], rffi.INT, compilation_info=eci, )