From e9aa0354065eab5b5e0828017776c424191c45a7 Mon Sep 17 00:00:00 2001 From: Radu Jipa Date: Wed, 14 Mar 2018 17:09:41 +0000 Subject: [PATCH] Fix deb version of PAM all caps naming When this module was transitioned from pip (0.1.4) to deb (0.4.2-13.1), the version in Raspbian contained an uppercase name for the module. This method of importing fixes this and accounts for the pkg being fixed in the future to be lowercase. --- kano_settings/system/account.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/kano_settings/system/account.py b/kano_settings/system/account.py index f9e0a11..40f85c3 100644 --- a/kano_settings/system/account.py +++ b/kano_settings/system/account.py @@ -1,15 +1,21 @@ -#!/usr/bin/env python - # account.py # -# Copyright (C) 2014 Kano Computing Ltd. +# Copyright (C) 2014-2018 Kano Computing Ltd. # License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 # # Contains the account screen backend functions + import os -import pam -from kano.utils import get_user_unsudoed, run_cmd + +# When this module was transitioned from pip (0.1.4) to deb (0.4.2-13.1), the +# version in Raspbian contained an all caps name for the module. +try: + import PAM as pam +except ImportError: + import pam + +from kano.utils import run_cmd from kano_world.functions import has_token