mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Feature: sys.orig_argv (#4048)
This commit is contained in:
1 parent
3630cfac2d
commit
c334626f3c
2 files changed
+5
-4
No files matched your search
Vendored
-4
@@ -484,8 +484,6 @@ class SysModuleTest(unittest.TestCase):
|
||||
leave_g.set()
|
||||
t.join()
|
||||
|
||||
# TODO: RUSTPYTHON, AttributeError: module 'sys' has no attribute 'orig_argv'
|
||||
@unittest.expectedFailure
|
||||
def test_attributes(self):
|
||||
self.assertIsInstance(sys.api_version, int)
|
||||
self.assertIsInstance(sys.argv, list)
|
||||
@@ -1006,8 +1004,6 @@ class SysModuleTest(unittest.TestCase):
|
||||
out = out.decode('ascii', 'replace').rstrip()
|
||||
self.assertEqual(out, 'mbcs replace')
|
||||
|
||||
# TODO: RUSTPYTHON, subprocess.CalledProcessError: Command ... returned non-zero exit status 1.
|
||||
@unittest.expectedFailure
|
||||
def test_orig_argv(self):
|
||||
code = textwrap.dedent('''
|
||||
import sys
|
||||
|
||||
@@ -217,6 +217,11 @@ mod sys {
|
||||
Vec::new()
|
||||
}
|
||||
|
||||
#[pyattr]
|
||||
fn orig_argv(vm: &VirtualMachine) -> Vec<PyObjectRef> {
|
||||
env::args().map(|arg| vm.ctx.new_str(arg).into()).collect()
|
||||
}
|
||||
|
||||
#[pyattr]
|
||||
fn path(vm: &VirtualMachine) -> Vec<PyObjectRef> {
|
||||
vm.state
|
||||
|
||||
Reference in new issue
Block a user