From 26b5040b31d953c1349f800cc7e193be2c923bd2 Mon Sep 17 00:00:00 2001 From: nggit Date: Tue, 31 Dec 2024 18:03:33 +0700 Subject: [PATCH] simpilfy logic --- tremolo/tremolo.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tremolo/tremolo.py b/tremolo/tremolo.py index 74f9bf9..2f97216 100644 --- a/tremolo/tremolo.py +++ b/tremolo/tremolo.py @@ -216,8 +216,7 @@ async def _serve(self, host, port, **options): # '/path/to/module.py' -> 'module:app' (dir: '/path/to') # '/path/to/module.py:myapp' -> 'module:myapp' (dir: '/path/to') - if (':\\' in options['app'] and options['app'].count(':') < 2 or - ':' not in options['app']): + if options['app'].find(':', options['app'].find(':\\') + 1) == -1: options['app'] += ':app' path, attr_name = options['app'].rsplit(':', 1)