From aeb2c31a1317fd9a86b2e48f5b71524537567cf5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 19:18:20 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pyvex/expr.py | 12 ++++++------ pyvex/stmt.py | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pyvex/expr.py b/pyvex/expr.py index 1f05d777..8a069326 100644 --- a/pyvex/expr.py +++ b/pyvex/expr.py @@ -1,8 +1,8 @@ from __future__ import annotations + import logging import re -from typing import Optional, TYPE_CHECKING - +from typing import TYPE_CHECKING from .const import U8, U16, U32, U64, IRConst, get_type_size from .enums import IRCallee, IRRegArray, VEXObject, get_enum_from_int, get_int_from_enum @@ -35,7 +35,7 @@ def _pp_str(self) -> str: raise NotImplementedError @property - def child_expressions(self) -> list["IRExpr"]: + def child_expressions(self) -> list[IRExpr]: """ A list of all of the expressions that this expression ends up evaluating. """ @@ -100,7 +100,7 @@ def replace_expression(self, replacements): v.replace_expression(replacements) @staticmethod - def _from_c(c_expr) -> Optional["IRExpr"]: + def _from_c(c_expr) -> IRExpr | None: if c_expr == ffi.NULL or c_expr[0] == ffi.NULL: return None @@ -621,14 +621,14 @@ class Const(IRExpr): tag = "Iex_Const" - def __init__(self, con: "IRConst"): + def __init__(self, con: IRConst): self._con = con def _pp_str(self): return str(self.con) @property - def con(self) -> "IRConst": + def con(self) -> IRConst: return self._con @staticmethod diff --git a/pyvex/stmt.py b/pyvex/stmt.py index 8a2fdc3e..c1dd1c25 100644 --- a/pyvex/stmt.py +++ b/pyvex/stmt.py @@ -1,8 +1,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING import logging from collections.abc import Iterator +from typing import TYPE_CHECKING from . import expr from .const import IRConst @@ -31,7 +31,7 @@ def pp(self): print(str(self)) @property - def child_expressions(self) -> Iterator["IRExpr"]: + def child_expressions(self) -> Iterator[IRExpr]: for k in self.__slots__: v = getattr(self, k) if isinstance(v, IRExpr): @@ -171,7 +171,7 @@ class Put(IRStmt): tag = "Ist_Put" - def __init__(self, data: "IRExpr", offset: int): + def __init__(self, data: IRExpr, offset: int): self.data = data self.offset = offset @@ -240,7 +240,7 @@ class WrTmp(IRStmt): tag = "Ist_WrTmp" - def __init__(self, tmp, data: "IRExpr"): + def __init__(self, tmp, data: IRExpr): self.tmp = tmp self.data = data @@ -278,7 +278,7 @@ class Store(IRStmt): tag = "Ist_Store" - def __init__(self, addr: "IRExpr", data: "IRExpr", end: str): + def __init__(self, addr: IRExpr, data: IRExpr, end: str): self.addr = addr self.data = data self.end = end