mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Remove code duplication.
This commit is contained in:
@@ -11,7 +11,7 @@ import traceback
|
||||
|
||||
from pydevd_plugin_utils import load_plugins, NullProxy, PluginProxy
|
||||
|
||||
from pydevd_frame import add_exception_to_frame
|
||||
from pydevd_frame_utils import add_exception_to_frame
|
||||
import pydev_imports
|
||||
from pydevd_breakpoints import * #@UnusedWildImport
|
||||
import fix_getpass
|
||||
|
||||
@@ -15,6 +15,8 @@ from pydevd_comm import CMD_ADD_DJANGO_EXCEPTION_BREAK, \
|
||||
CMD_STEP_INTO, CMD_SMART_STEP_INTO, CMD_RUN_TO_LINE, CMD_SET_NEXT_STATEMENT
|
||||
from pydevd_constants import * # @UnusedWildImport
|
||||
from pydevd_file_utils import GetFilenameAndBase
|
||||
|
||||
from pydev_frame_utils import add_exception_to_frame
|
||||
try:
|
||||
from pydevd_signature import sendSignatureCallTrace
|
||||
except ImportError:
|
||||
@@ -564,6 +566,3 @@ class PyDBFrame:
|
||||
if flag:
|
||||
frame = suspend_django(self, mainDebugger, thread, frame)
|
||||
return flag, frame
|
||||
|
||||
def add_exception_to_frame(frame, exception_info):
|
||||
frame.f_locals['__exception__'] = exception_info
|
||||
@@ -21,3 +21,6 @@ class FCode:
|
||||
def __init__(self, name, filename):
|
||||
self.co_name = name
|
||||
self.co_filename = filename
|
||||
|
||||
def add_exception_to_frame(frame, exception_info):
|
||||
frame.f_locals['__exception__'] = exception_info
|
||||
|
||||
@@ -6,7 +6,7 @@ from pydevd_breakpoints import LineBreakpoint, get_exception_name
|
||||
import pydevd_vars
|
||||
import traceback
|
||||
import pydev_log
|
||||
from pydevd_frame import add_exception_to_frame
|
||||
from pydevd_frame_utils import add_exception_to_frame, FCode
|
||||
|
||||
|
||||
class DjangoLineBreakpoint(LineBreakpoint):
|
||||
@@ -252,12 +252,6 @@ class DjangoTemplateFrame:
|
||||
d[k] = value
|
||||
|
||||
|
||||
class FCode:
|
||||
def __init__(self, name, filename):
|
||||
self.co_name = name
|
||||
self.co_filename = filename
|
||||
|
||||
|
||||
def is_django_exception_break_context(frame):
|
||||
try:
|
||||
name = frame.f_code.co_name
|
||||
|
||||
@@ -3,7 +3,7 @@ from pydevd_constants import JINJA2_SUSPEND, GetThreadId, STATE_SUSPEND, DictCon
|
||||
from pydevd_comm import CMD_SET_BREAK, CMD_STEP_OVER, CMD_ADD_EXCEPTION_BREAK
|
||||
import pydevd_vars
|
||||
from pydevd_file_utils import GetFileNameAndBaseFromFile
|
||||
from pydevd_frame import add_exception_to_frame
|
||||
from pydevd_frame_utils import add_exception_to_frame, FCode
|
||||
|
||||
class Jinja2LineBreakpoint(LineBreakpoint):
|
||||
|
||||
@@ -138,11 +138,6 @@ class Jinja2TemplateFrame:
|
||||
if k == name:
|
||||
self.back_context.vars[k] = value
|
||||
|
||||
class FCode:
|
||||
def __init__(self, name, filename):
|
||||
self.co_name = name
|
||||
self.co_filename = filename
|
||||
|
||||
def is_missing(item):
|
||||
if item.__class__.__name__ is 'MissingType':
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user