~carresmd-deactivatedaccount/lottanzb/bug_384916

« back to all changes in this revision

Viewing changes to lottanzb/resources/__init__.py

  • Committer: Severin Heiniger
  • Date: 2009-09-06 11:16:05 UTC
  • Revision ID: severinheiniger@gmail.com-20090906111605-8ia5e8j1uceetycr
Use the recursive os.makedirs instead of os.mkdir to create the user-specific directories. Fixes #425154.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
# along with this program; if not, write to the Free Software
14
14
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
15
15
 
16
 
from os import mkdir
 
16
from os import makedirs
17
17
from os.path import join, isdir
18
18
 
19
19
from lottanzb.resources import xdg
59
59
def create_user_dirs():
60
60
    for directory in [get_config(), get_user_data(), get_user_temp()]:
61
61
        if not isdir(directory):
62
 
            mkdir(directory)
 
62
            # ~/.local or ~/.local/share may not exist on fresh installations.
 
63
            # Therefore use the recursive version of the `mkdir` function.
 
64
            makedirs(directory)