[PATCH] D67816: [LNT] Python 3 support: use int() instead of long()

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 21 08:01:53 PDT 2019


hubert.reinterpretcast accepted this revision.
hubert.reinterpretcast marked an inline comment as done.
hubert.reinterpretcast added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lnt/tests/compile.py:532
             if result != "fail":
-                bytes = long(result)
+                bytes = int(result)
                 success = True
----------------
thopre wrote:
> hubert.reinterpretcast wrote:
> > Is this okay for 32-bit Python 2?
> According to the Conservative Python 3 Porting Guide [1]:
> 
> In Python 2, calling int on a number that doesn’t fit in the machine int range would automatically create a long with the appropriate value.
> 
> [1] https://portingguide.readthedocs.io/en/latest/numbers.html
> 
> So yes this should be safe.
Thanks for checking. LGTM.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67816/new/

https://reviews.llvm.org/D67816





More information about the llvm-commits mailing list