Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, directory=None):
"""Init the stuff."""
if directory is None:
directory = DEFAULT.SONG_DIR
# Check the dir only if special characters are present
if '$' in directory:
directory = os.path.dirname(directory)
directory = os.path.expanduser(directory)
self.directory = directory