Changeset 2688

Show
Ignore:
Timestamp:
03/28/17 04:49:26 (2 months ago)
Author:
jwoithe
Message:

ffado-mixer: the ConfigParser? module as used by the registration code has been renamed to configparser in python3. Allow for this in a way which maintains compatibility with python2.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/support/mixer-qt4/ffado/registration.py

    r2687 r2688  
    2323 
    2424import urllib 
    25 import ConfigParser, os 
     25import os 
     26 
     27# Python3 renamed ConfigParser to configparser.  Deal with this in a way 
     28# which maintains compatibility with python2. 
     29try: 
     30    from configparser import SafeConfigParser 
     31except: 
     32    from ConfigParser import SafeConfigParser 
    2633 
    2734from ffado.config import REGISTER_URL, INI_FILE_PATH, FFADO_CONFIG_DIR 
     
    5764        # parse the ini file 
    5865        self.config_filename = os.path.expanduser(INI_FILE_PATH) 
    59         self.parser = ConfigParser.SafeConfigParser() 
     66        self.parser = SafeConfigParser() 
    6067        self.parser.read(self.config_filename) 
    6168        self.section_name = "%s:%X" % (self.ffado_version, self.guid)