Skip to content

Commit

Permalink
Fixed 2.6 backwards incompatibility for format syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
comrumino committed Jul 27, 2019
1 parent d4445a1 commit 9c450f6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions demos/echo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def echo_forever(main_queue, main_event):
except Exception:
import traceback
traceback.print_exc()
print("EXCEPT ('{}', {}) with fd {} over {}s".format(addr, port, fileno, cdelta + delta))
print("EXCEPT ('{0}', {1}) with fd {2} over {3}s".format(addr, port, fileno, cdelta + delta))
finally:
main_queue.put(_max)

Expand All @@ -57,7 +57,7 @@ def main():
eid_proc[eid] = proc
while True:
alive = len([_proc for _proc in eid_proc.values() if _proc.is_alive()])
print('{}/{} alive'.format(alive, limit))
print('{0}/{1} alive'.format(alive, limit))
if alive == 0:
print('All of the client processes are dead. Exiting loop...')
break
Expand All @@ -82,8 +82,8 @@ def main():
else:
delta = "unknown"
time.sleep(1)
print("Max time to establish: {}".format(cdelta))
print("Max time echo reply: {}".format(delta))
print("Max time to establish: {0}".format(cdelta))
print("Max time echo reply: {0}".format(delta))
print(cdelta, delta)


Expand Down
2 changes: 1 addition & 1 deletion rpyc/core/vinegar.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

REMOTE_LINE_START = "\n\n========= Remote Traceback "
REMOTE_LINE_END = " =========\n"
REMOTE_LINE = "{}({{}}){}".format(REMOTE_LINE_START, REMOTE_LINE_END)
REMOTE_LINE = "{0}({{}}){1}".format(REMOTE_LINE_START, REMOTE_LINE_END)


try:
Expand Down
4 changes: 2 additions & 2 deletions rpyc/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ def exp_backoff(collision):
def get_id_pack(obj):
"""introspects the given (local) object, returns id_pack as expected by BaseNetref"""
if not inspect.isclass(obj):
name_pack = '{}.{}'.format(obj.__class__.__module__, obj.__class__.__name__)
name_pack = '{0}.{1}'.format(obj.__class__.__module__, obj.__class__.__name__)
return (name_pack, id(type(obj)), id(obj))
else:
name_pack = '{}.{}'.format(obj.__module__, obj.__name__)
name_pack = '{0}.{1}'.format(obj.__module__, obj.__name__)
return (name_pack, id(obj), 0)


Expand Down

0 comments on commit 9c450f6

Please # to comment.