forked from VimPlug/jedi
Make the profile_output script usable for Python 2 as well
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env python3.6
|
#!/usr/bin/env python3.6
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
"""
|
"""
|
||||||
Profile a piece of Python code with ``profile``. Tries a completion on a
|
Profile a piece of Python code with ``profile``. Tries a completion on a
|
||||||
certain piece of code.
|
certain piece of code.
|
||||||
@@ -18,6 +19,10 @@ Options:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
try:
|
||||||
|
# For Python 2
|
||||||
|
import cProfile as profile
|
||||||
|
except ImportError:
|
||||||
import profile
|
import profile
|
||||||
import pstats
|
import pstats
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user