| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 61404c4 commit 436cd65
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -537,12 +537,10 @@ def byte_IMPORT_NAME(self, opcode): | |||
| 537 | 537 | # The IMPORT_NAME for an "import a.b.c" will push the module "a". | |
| 538 | 538 | # However, for "from a.b.c import Foo" it'll push the module "a.b.c". Those | |
| 539 | 539 | # two cases are distinguished by whether fromlist is None or not. | |
| 540 | - try: | ||
| 541 | - abstract.get_atomic_constant(fromlist, None) | ||
| 542 | - except ValueError: | ||
| 543 | - module_name = full_name | ||
| 544 | - else: | ||
| 540 | + if fromlist.has_atomic_value(self._ctx.consts[None]): | ||
| 545 | 541 | module_name = full_name.split('.', 1)[0] # "a.b.c" -> "a" | |
| 542 | + else: | ||
| 543 | + module_name = full_name | ||
| 546 | 544 | module = abstract.Module(self._ctx, module_name) | |
| 547 | 545 | return self._stack.push(module.to_variable()) | |
| 548 | 546 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,6 +47,14 @@ def f(x, *, y): | |||
| 47 | 47 | f(0, y=1) | |
| 48 | 48 | """) | |
| 49 | 49 | ||
| 50 | + def test_function_varargs(self): | ||
| 51 | + self.Check(""" | ||
| 52 | + def foo(x: str, *args): | ||
| 53 | + pass | ||
| 54 | + def bar(*args): | ||
| 55 | + foo('abc', *args) | ||
| 56 | + """) | ||
| 57 | + | ||
| 50 | 58 | def test_class(self): | |
| 51 | 59 | self.Check(""" | |
| 52 | 60 | class C: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments