From ee03c669aed0d2f20eefb2048b5de4d8470942c4 Mon Sep 17 00:00:00 2001
From: ussrhero <ussrhero@outlook.com>
Date: Sat, 1 Jun 2019 00:19:22 +0300
Subject: [PATCH] fixed python long to typedVar conversion

---
 pykd/variant.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/pykd/variant.h b/pykd/variant.h
index 44a0c6f..39a7f5d 100644
--- a/pykd/variant.h
+++ b/pykd/variant.h
@@ -51,7 +51,7 @@ public:
 
         if (PyLong_Check(obj.ptr()))
         {
-            if (_PyLong_Sign(obj.ptr()) >= 0)
+            if (_PyLong_NumBits(obj.ptr()) > 63)
             {
                 if (_PyLong_NumBits(obj.ptr()) > 64)
                     throw pykd::OverflowException("int too big to convert");
@@ -60,9 +60,6 @@ public:
             }
             else
             {
-                if (_PyLong_NumBits(obj.ptr()) > 63)
-                    throw pykd::OverflowException("int too big to convert");
-
                 var.setLongLong(PyLong_AsLongLong(obj.ptr()));
             }