Philipp Hörist pushed to branch master at gajim / gajim

Commits:

1 changed file:

Changes:

  • gajim/common/helpers.py
    ... ... @@ -1484,14 +1484,14 @@ def get_available_emoticon_themes():
    1484 1484
             emoticons_themes.append('font')
    
    1485 1485
     
    
    1486 1486
         files = []
    
    1487
    -    with os.scandir(configpaths.get('EMOTICONS')) as scan:
    
    1488
    -        for entry in scan:
    
    1489
    -            if not entry.is_dir():
    
    1490
    -                continue
    
    1491
    -            with os.scandir(entry.path) as scan_theme:
    
    1492
    -                for theme in scan_theme:
    
    1493
    -                    if theme.is_file():
    
    1494
    -                        files.append(theme.name)
    
    1487
    +    dir_iterator = os.scandir(configpaths.get('EMOTICONS'))
    
    1488
    +    for folder in dir_iterator:
    
    1489
    +        if not folder.is_dir():
    
    1490
    +            continue
    
    1491
    +        file_iterator = os.scandir(folder.path)
    
    1492
    +        for theme in file_iterator:
    
    1493
    +            if theme.is_file():
    
    1494
    +                files.append(theme.name)
    
    1495 1495
     
    
    1496 1496
         if os.path.isdir(configpaths.get('MY_EMOTS')):
    
    1497 1497
             files += os.listdir(configpaths.get('MY_EMOTS'))