def _create_database(self): """ Create a persistent database to store expensive parse results Check for Python version used to create the database is the same as the running python instance or re-create """ project_database_file_name = join(self._output_path, "project_database") create_new = False key = b"version" version = str((6, sys.version)).encode() database = None try: database = DataBase(project_database_file_name) create_new = (key not in database) or (database[key] != version) except KeyboardInterrupt: raise except: # pylint: disable=bare-except traceback.print_exc() create_new = True if create_new: database = DataBase(project_database_file_name, new=True) database[key] = version return PickledDataBase(database)
def create_database(tempdir, new=False): return PickledDataBase(TestDataBase.create_database(tempdir, new))
def create_database(self, new=False): return PickledDataBase(TestDataBase.create_database(self, new))