Fix a regression with compiling a brand-new LessCSS file.

Review Request #11430 — Created Feb. 3, 2021 and submitted

Information

Djblets
release-2.x

Reviewers

The new logic for optimizing outdated file checks made an assumption
that the destination file always exists. It tried comparing the source
file's timestamp to the destination's, which would be None. This would
execute just fine on Python 2.7, but not on Python 3, where these types
are not comparable.

This change fixes this by short-circuiting the timestamp comparisons if
None. Unit tests were added to ensure this works correctly on all
versions of Python.

Unit tests pass for all versions of Python.

Encountered this issue during development of a new .less file, and
verified this fixed it.

Summary ID
Fix a regression with compiling a brand-new LessCSS file.
The new logic for optimizing outdated file checks made an assumption that the destination file always exists. It tried comparing the source file's timestamp to the destination's, which would be `None`. This would execute just fine on Python 2.7, but not on Python 3, where these types are not comparable. This change fixes this by short-circuiting the timestamp comparisons if `None`. Unit tests were added to ensure this works correctly on all versions of Python.
25a9f043b38d97f38be7f0287aa85b372acf3b1b
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.x (00c0563)
Loading...