Skip to content

Commit d6e42cb

Browse files
LucidOneJamim
andauthored
Check that infile is not a directory
Co-Authored-By: Aliaksei Urbanski <mimworkmail@gmail.com>
1 parent 9d7a288 commit d6e42cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/configobj/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,7 @@ def _load(self, infile, configspec):
12121212

12131213
if isinstance(infile, six.string_types):
12141214
self.filename = infile
1215-
if os.path.exists(infile):
1215+
if os.path.exists(infile) and not os.path.isdir(infile):
12161216
with open(infile, 'rb') as h:
12171217
content = h.readlines() or []
12181218
elif self.file_error:

0 commit comments

Comments
 (0)