Skip to content

Commit

Permalink
Force absolute imports, division and print function across all modules.
Browse files Browse the repository at this point in the history
With the absolute imports, this fixes an issue with pudb/shell.py where it
was confusing importing the IPython package with the pudb.ipython module,
as detailed in the [github case
here](#194).
  • Loading branch information
rory-geoghegan-ecometrica committed Aug 3, 2016
1 parent f46002a commit 5038b12
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pudb/__init__.py
@@ -1,3 +1,6 @@

from __future__ import absolute_import, division, print_function

NUM_VERSION = (2016, 2)
VERSION = ".".join(str(nv) for nv in NUM_VERSION)
__version__ = VERSION
Expand Down
3 changes: 3 additions & 0 deletions pudb/__main__.py
@@ -1,3 +1,6 @@

from __future__ import absolute_import, division, print_function

if __name__ == "__main__":
from pudb.run import main
main()
2 changes: 2 additions & 0 deletions pudb/b.py
@@ -1,3 +1,5 @@

from __future__ import absolute_import, division, print_function
import sys

from pudb import _get_debugger, set_interrupt_handler
Expand Down
2 changes: 1 addition & 1 deletion pudb/debugger.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import division
from __future__ import absolute_import, division, print_function
import urwid
import bdb
import sys
Expand Down
2 changes: 1 addition & 1 deletion pudb/ipython.py
@@ -1,5 +1,5 @@
from __future__ import with_statement

from __future__ import absolute_import, division, print_function, with_statement
import sys
import os

Expand Down
1 change: 1 addition & 0 deletions pudb/lowlevel.py
@@ -1,3 +1,4 @@
from __future__ import absolute_import, division, print_function
from pudb.py3compat import PY3


Expand Down
1 change: 1 addition & 0 deletions pudb/py3compat.py
@@ -1,3 +1,4 @@
from __future__ import absolute_import, division, print_function
import sys

PY3 = sys.version_info[0] >= 3
Expand Down
2 changes: 2 additions & 0 deletions pudb/run.py
@@ -1,3 +1,5 @@
from __future__ import absolute_import, division, print_function

def main():
import sys

Expand Down
2 changes: 2 additions & 0 deletions pudb/settings.py
@@ -1,3 +1,5 @@
from __future__ import absolute_import, division, print_function

import os
import sys

Expand Down
2 changes: 2 additions & 0 deletions pudb/shell.py
@@ -1,3 +1,5 @@
from __future__ import absolute_import, division, print_function

try:
import bpython # noqa
# Access a property to verify module exists in case
Expand Down
2 changes: 2 additions & 0 deletions pudb/source_view.py
@@ -1,3 +1,5 @@
from __future__ import absolute_import, division, print_function

import urwid


Expand Down
2 changes: 2 additions & 0 deletions pudb/theme.py
@@ -1,3 +1,5 @@
from __future__ import absolute_import, division, print_function

THEMES = ["classic", "vim", "dark vim", "midnight", "solarized", "agr-256"]

from pudb.py3compat import execfile, raw_input
Expand Down
1 change: 1 addition & 0 deletions pudb/ui_tools.py
@@ -1,3 +1,4 @@
from __future__ import absolute_import, division, print_function
import urwid
from urwid.util import _target_encoding

Expand Down
1 change: 1 addition & 0 deletions pudb/var_view.py
Expand Up @@ -2,6 +2,7 @@

# {{{ constants and imports

from __future__ import absolute_import, division, print_function
import urwid

try:
Expand Down

0 comments on commit 5038b12

Please sign in to comment.