Skip to content

Commit 5881019

Browse files
authored
main() should be sync (#1339)
main() should be sync.
1 parent 12859d0 commit 5881019

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

pymodbus/server/simulator/main.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@
4747
from pymodbus.server.simulator.http_server import ModbusSimulatorServer
4848

4949

50-
async def run():
51-
"""Run simulator."""
52-
53-
5450
def get_commandline():
5551
"""Get command line arguments."""
5652
parser = argparse.ArgumentParser(
@@ -110,13 +106,12 @@ def get_commandline():
110106
return cmd_args
111107

112108

113-
async def main():
109+
def main():
114110
"""Run server."""
115111
cmd_args = get_commandline()
116112
task = ModbusSimulatorServer(**cmd_args)
117-
118-
await task.run_forever()
113+
asyncio.run(task.run_forever(), debug=True)
119114

120115

121116
if __name__ == "__main__":
122-
asyncio.run(main(), debug=True)
117+
main()

0 commit comments

Comments
 (0)