Skip to content

Commit

Permalink
Merge pull request #85 from learningequality/defuse-the-bomb
Browse files Browse the repository at this point in the history
Catch permission errors creating the (unused?) app files dir, because it blows up Android
  • Loading branch information
jamalex authored Jul 30, 2021
2 parents cc4a96c + 1b2e403 commit a43b211
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ def flush(self):
KOLIBRI_ROOT_URL = 'http://localhost:{}'.format(KOLIBRI_PORT)
os.environ["DJANGO_SETTINGS_MODULE"] = "kolibri.deployment.default.settings.base"

app_data_dir = pew.get_app_files_dir()
os.makedirs(app_data_dir, exist_ok=True)

try:
os.makedirs(pew.get_app_files_dir(), exist_ok=True)
except PermissionError:
pass

if not 'KOLIBRI_HOME' in os.environ:
kolibri_home = os.path.join(os.path.expanduser("~"), ".kolibri")

Expand Down

0 comments on commit a43b211

Please sign in to comment.