mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
[saltstack/salt#31194] Make the code simple because IndexError exception has very rare chance to be raised at 'os.path.abspath(__file__).rsplit('/')[-2]', advised by @whiteinge.
This commit is contained in:
parent
f56a551a22
commit
cfab276324
@ -20,11 +20,7 @@ try:
|
|||||||
except ImportError as exc:
|
except ImportError as exc:
|
||||||
cpy_error = exc
|
cpy_error = exc
|
||||||
|
|
||||||
|
__virtualname__ = os.path.abspath(__file__).rsplit('/')[-2] or 'rest_cherrypy'
|
||||||
try:
|
|
||||||
__virtualname__ = os.path.abspath(__file__).rsplit('/')[-2]
|
|
||||||
except IndexError:
|
|
||||||
__virtualname__ = 'rest_cherrypy'
|
|
||||||
|
|
||||||
logger = logging.getLogger(__virtualname__)
|
logger = logging.getLogger(__virtualname__)
|
||||||
cpy_min = '3.2.2'
|
cpy_min = '3.2.2'
|
||||||
|
@ -6,10 +6,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import distutils.version # pylint: disable=no-name-in-module
|
import distutils.version # pylint: disable=no-name-in-module
|
||||||
|
|
||||||
try:
|
__virtualname__ = os.path.abspath(__file__).rsplit('/')[-2] or 'rest_cherrypy'
|
||||||
__virtualname__ = os.path.abspath(__file__).rsplit('/')[-2]
|
|
||||||
except IndexError:
|
|
||||||
__virtualname__ = 'rest_tornado'
|
|
||||||
|
|
||||||
logger = logging.getLogger(__virtualname__)
|
logger = logging.getLogger(__virtualname__)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user