Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
4 additions
and
0 deletions.
-
+2
−0
tests/modules/test_process.py
-
+2
−0
topaz/objspace.py
|
@@ -15,6 +15,8 @@ def test_euid(self, space): |
|
|
def test_pid(self, space): |
|
|
w_res = space.execute("return Process.pid") |
|
|
assert space.int_w(w_res) == os.getpid() |
|
|
w_res = space.execute("return $$") |
|
|
assert space.int_w(w_res) == os.getpid() |
|
|
|
|
|
def test_exit(self, space): |
|
|
with self.raises(space, "SystemExit"): |
|
|
|
@@ -224,6 +224,8 @@ def __init__(self, config): |
|
|
self.globals.define_virtual("$LOAD_PATH", lambda space: space.w_load_path) |
|
|
self.globals.define_virtual("$:", lambda space: space.w_load_path) |
|
|
|
|
|
self.globals.define_virtual("$$", lambda space: space.send(space.getmoduleobject(Process.moduledef), "pid")) |
|
|
|
|
|
self.w_loaded_features = self.newarray([]) |
|
|
self.globals.define_virtual("$LOADED_FEATURES", lambda space: space.w_loaded_features) |
|
|
self.globals.define_virtual('$"', lambda space: space.w_loaded_features) |
|
|