diff mbox series

[v5,29/36] qapi/gen.py: Remove unused parameter

Message ID 20201005195158.2348217-30-jsnow@redhat.com
State Superseded
Headers show
Series qapi: static typing conversion, pt1 | expand

Commit Message

John Snow Oct. 5, 2020, 7:51 p.m. UTC
module_basename doesn't use the 'what' argument, so remove it.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
---
 scripts/qapi/gen.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Markus Armbruster Oct. 7, 2020, 12:22 p.m. UTC | #1
John Snow <jsnow@redhat.com> writes:

> module_basename doesn't use the 'what' argument, so remove it.


_module_dirname(), I suppose.

>

> Signed-off-by: John Snow <jsnow@redhat.com>

> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>

> Reviewed-by: Cleber Rosa <crosa@redhat.com>

> ---

>  scripts/qapi/gen.py | 4 ++--

>  1 file changed, 2 insertions(+), 2 deletions(-)

>

> diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py

> index d0391cd8718..3624162bb77 100644

> --- a/scripts/qapi/gen.py

> +++ b/scripts/qapi/gen.py

> @@ -259,7 +259,7 @@ def _is_user_module(name: Optional[str]) -> bool:

>      def _is_builtin_module(name: Optional[str]) -> bool:

>          return not name

>  

> -    def _module_dirname(self, what: str, name: Optional[str]) -> str:

> +    def _module_dirname(self, name: Optional[str]) -> str:

>          if self._is_user_module(name):

>              return os.path.dirname(name)

>          return ''

> @@ -277,7 +277,7 @@ def _module_basename(self, what: str, name: Optional[str]) -> str:

>          return ret

>  

>      def _module_filename(self, what: str, name: Optional[str]) -> str:

> -        return os.path.join(self._module_dirname(what, name),

> +        return os.path.join(self._module_dirname(name),

>                              self._module_basename(what, name))

>  

>      def _add_module(self, name: Optional[str], blurb: str) -> None:
John Snow Oct. 7, 2020, 4:23 p.m. UTC | #2
On 10/7/20 8:22 AM, Markus Armbruster wrote:
> John Snow <jsnow@redhat.com> writes:

> 

>> module_basename doesn't use the 'what' argument, so remove it.

> 

> _module_dirname(), I suppose.

> 


My brain just translates stuff I didn't ask it to all the time. (Fixed.)

>>

>> Signed-off-by: John Snow <jsnow@redhat.com>

>> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>

>> Reviewed-by: Cleber Rosa <crosa@redhat.com>

>> ---

>>   scripts/qapi/gen.py | 4 ++--

>>   1 file changed, 2 insertions(+), 2 deletions(-)

>>

>> diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py

>> index d0391cd8718..3624162bb77 100644

>> --- a/scripts/qapi/gen.py

>> +++ b/scripts/qapi/gen.py

>> @@ -259,7 +259,7 @@ def _is_user_module(name: Optional[str]) -> bool:

>>       def _is_builtin_module(name: Optional[str]) -> bool:

>>           return not name

>>   

>> -    def _module_dirname(self, what: str, name: Optional[str]) -> str:

>> +    def _module_dirname(self, name: Optional[str]) -> str:

>>           if self._is_user_module(name):

>>               return os.path.dirname(name)

>>           return ''

>> @@ -277,7 +277,7 @@ def _module_basename(self, what: str, name: Optional[str]) -> str:

>>           return ret

>>   

>>       def _module_filename(self, what: str, name: Optional[str]) -> str:

>> -        return os.path.join(self._module_dirname(what, name),

>> +        return os.path.join(self._module_dirname(name),

>>                               self._module_basename(what, name))

>>   

>>       def _add_module(self, name: Optional[str], blurb: str) -> None:
diff mbox series

Patch

diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py
index d0391cd8718..3624162bb77 100644
--- a/scripts/qapi/gen.py
+++ b/scripts/qapi/gen.py
@@ -259,7 +259,7 @@  def _is_user_module(name: Optional[str]) -> bool:
     def _is_builtin_module(name: Optional[str]) -> bool:
         return not name
 
-    def _module_dirname(self, what: str, name: Optional[str]) -> str:
+    def _module_dirname(self, name: Optional[str]) -> str:
         if self._is_user_module(name):
             return os.path.dirname(name)
         return ''
@@ -277,7 +277,7 @@  def _module_basename(self, what: str, name: Optional[str]) -> str:
         return ret
 
     def _module_filename(self, what: str, name: Optional[str]) -> str:
-        return os.path.join(self._module_dirname(what, name),
+        return os.path.join(self._module_dirname(name),
                             self._module_basename(what, name))
 
     def _add_module(self, name: Optional[str], blurb: str) -> None: