Skip to content

Commit

Permalink
Fixed undefined name error due to typo and Replaced % formatting with…
Browse files Browse the repository at this point in the history
… f-strings to improve readability and have consistent formatting string syntax for RPyC -- rpyc/lib/__init__.py
  • Loading branch information
comrumino committed Aug 8, 2021
1 parent 58526b1 commit 2bd5171
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rpyc/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def __init__(self, name):

def __getattr__(self, name):
if name.startswith("__"): # issue 71
raise AttributeError("module %r not found" % (self.__name,))
raise ImportError("module %r not found" % (self.__name,))
raise AttributeError(f"module {self.__name!r} not found")
raise ImportError(f"module {self.__name!r} not found")

def __bool__(self):
return False
Expand Down Expand Up @@ -175,7 +175,7 @@ def get_id_pack(obj):
else:
name_pack = '{0}.{1}'.format(obj.__class__.__module__, obj.__name__)
elif inspect.ismodule(obj):
name_pack = '{0}.{1}'.format(obj__module__, obj.__name__)
name_pack = '{0}.{1}'.format(obj.__module__, obj.__name__)
print(name_pack)
elif hasattr(obj, '__module__'):
name_pack = '{0}.{1}'.format(obj.__module__, obj.__name__)
Expand Down

0 comments on commit 2bd5171

Please sign in to comment.