Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit cc36eda

Browse files
committed
Merge pull request #32 from alanjds/patch-1
[FIX] "UnboundLocalError: local variable 'mtime' " when with --watch
2 parents 4da2dc1 + 37087b6 commit cc36eda

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/changes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ To be released.
99
- Follow up the libsass upstream: :upcommit:`3.0.2` ---
1010
See the `release note`__ of libsass.
1111
[:issue:`33` by Rodolphe Pelloux-Prayer]
12+
- Fixed a bug that :program:`sassc --watch` crashed when a file is not
13+
compilable on the first try. [:issue:`32` by Alan Justino da Silva]
1214

1315
__ https://github.com/sass/libsass/releases/tag/3.0.2
1416

sassc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def main(argv=sys.argv, stdout=sys.stdout, stderr=sys.stderr):
114114
pass
115115
while True:
116116
try:
117+
mtime = os.stat(filename).st_mtime
117118
if options.source_map:
118119
source_map_filename = args[1] + '.map' # FIXME
119120
css, source_map = compile(
@@ -132,7 +133,6 @@ def main(argv=sys.argv, stdout=sys.stdout, stderr=sys.stderr):
132133
include_paths=options.include_paths,
133134
image_path=options.image_path
134135
)
135-
mtime = os.stat(filename).st_mtime
136136
except (IOError, OSError) as e:
137137
error(e)
138138
return 3

0 commit comments

Comments
 (0)