Skip to content

Commit 04c3406

Browse files
yggdrsdispater
authored andcommitted
Fix double file opening. (#18)
This fixes call to pendulum.now() (without arguments) which raised TypeError.
1 parent dcaa7c1 commit 04c3406

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pendulum/tz/local_timezone.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ def get_tz_name_for_unix(cls):
141141

142142
if not os.path.exists(tzpath):
143143
continue
144-
with open(tzpath, 'rb') as tzfile:
145-
return Timezone('', *Parser.parse(tzfile))
144+
return Timezone('', *Parser.parse(tzpath))
146145

147146
raise RuntimeError('Can not find any timezone configuration')
148147

148+
149149
def _tz_from_env(tzenv):
150150
if tzenv[0] == ':':
151151
tzenv = tzenv[1:]

0 commit comments

Comments
 (0)