Skip to content

Commit b60a0df

Browse files
committed
Fix missing config file try/catch
1 parent e3d0d92 commit b60a0df

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pygitlab.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,12 @@ def number_to_perm_type(perm_types, perm_number):
275275

276276
gl = None
277277

278-
cp = configparser.ConfigParser()
279-
cp.read(args.configfile)
278+
try:
279+
cp = configparser.ConfigParser()
280+
cp.read(args.configfile)
281+
except TypeError:
282+
logger.error("Can't read config from %s. Please specify another config file with -c <path>." % args.configfile)
283+
exit(-1)
280284
try:
281285
password = cp.get("default", "password")
282286
email = cp.get("default", "email")

0 commit comments

Comments
 (0)