Skip to content

Commit

Permalink
fix: more name fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Dec 8, 2023
1 parent 3d50f82 commit 8015dae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/ape/contracts/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,8 @@ def __getattr__(self, attr_name: str) -> Any:
):
# ABI should not contain a mix of events, mutable and view methods that match
# NOTE: `__getattr__` *must* raise `AttributeError`
raise ApeAttributeError(f"{ContractInstance.__name__} has corrupted ABI.")
cls_name = getattr(type(self), "__name__", ContractInstance.__name__)
raise ApeAttributeError(f"{cls_name} has corrupted ABI.")

if attr_name in self._view_methods_:
return self._view_methods_[attr_name]
Expand Down
3 changes: 2 additions & 1 deletion src/ape/managers/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,8 @@ def pending_timestamp(self, new_value: str):

def __repr__(self) -> str:
props = f"id={self.chain_id}" if self.network_manager.active_provider else "disconnected"
return f"<{ChainManager.__name__} ({props})>"
cls_name = getattr(type(self), "__name__", ChainManager.__name__)
return f"<{cls_name} ({props})>"

def snapshot(self) -> SnapshotID:
"""
Expand Down
3 changes: 2 additions & 1 deletion src/ape/managers/compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class CompilerManager(BaseManager):

def __repr__(self):
num_compilers = len(self.registered_compilers)
return f"<{CompilerManager.__name__} len(registered_compilers)={num_compilers}>"
cls_name = getattr(type(self), "__name__", CompilerManager.__name__)
return f"<{cls_name} len(registered_compilers)={num_compilers}>"

def __getattr__(self, name: str) -> Any:
try:
Expand Down

0 comments on commit 8015dae

Please sign in to comment.