Upate 3.5.1

This commit is contained in:
Yoshiko2
2020-07-17 15:06:42 +08:00
committed by GitHub
parent df3a959852
commit 82315472f6
4 changed files with 25 additions and 7 deletions

View File

@@ -1,12 +1,16 @@
import os
import configparser
import codecs
class Config:
def __init__(self, path: str = "config.ini"):
if os.path.exists(path):
self.conf = configparser.ConfigParser()
self.conf.read(path, encoding="utf-8")
try:
self.conf.read(path, encoding="utf-8-sig")
except:
self.conf.read(path, encoding="utf-8")
else:
print("[-] Config file not found! Use the default settings")
self.conf = self._default_config()