Skip to content

Commit 902e01b

Browse files
committed
Fix time_ns on python3.6
1 parent 0a760a2 commit 902e01b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

qiling/os/qnx/syscall.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
44
#
55

6-
from time import time_ns
6+
try:
7+
from time import time_ns
8+
except ImportError:
9+
from datetime import datetime
10+
# For compatibility with Python 3.6
11+
def time_ns():
12+
now = datetime.now()
13+
return int(now.timestamp() * 1e9)
14+
715
from binascii import hexlify
816

917
from qiling.utils import ql_get_module_function

0 commit comments

Comments
 (0)