Skip to content

Commit c0200e0

Browse files
committed
Upgrade Python syntax with pyupgrade --py36-plus
1 parent fdcfae2 commit c0200e0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

livereload/server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def alert():
240240
if isinstance(func, str):
241241
cmd = func
242242
func = shell(func)
243-
func.name = "shell: {}".format(cmd)
243+
func.name = f"shell: {cmd}"
244244

245245
self.watcher.watch(filepath, func, delay, ignore=ignore)
246246

@@ -330,7 +330,7 @@ def serve(self, port=5500, liveport=None, host=None, root=None, debug=None,
330330
self.root = root
331331

332332
self._setup_logging()
333-
logger.info('Serving on http://{}:{}'.format(host, port))
333+
logger.info(f'Serving on http://{host}:{port}')
334334

335335
self.default_filename = default_filename
336336

@@ -344,7 +344,7 @@ def serve(self, port=5500, liveport=None, host=None, root=None, debug=None,
344344

345345
def opener():
346346
time.sleep(open_url_delay)
347-
webbrowser.open('http://{}:{}'.format(host, port))
347+
webbrowser.open(f'http://{host}:{port}')
348348
threading.Thread(target=opener).start()
349349

350350
try:

livereload/watcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def examine(self):
107107
if not name:
108108
name = getattr(func, '__name__', 'anonymous')
109109
logger.info(
110-
"Running task: {} (delay: {})".format(name, delay))
110+
f"Running task: {name} (delay: {delay})")
111111
if sys.version_info.major < 3:
112112
sig_len = len(inspect.getargspec(func)[0])
113113
else:

0 commit comments

Comments
 (0)