Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for EOL Python 2 #61

Merged
merged 3 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# python-mpegdash

MPEG-DASH MPD (Media Presentation Description) Parser compatible with Python 2.6+ and Python 3.
MPEG-DASH MPD (Media Presentation Description) Parser compatible with Python 3+.

[![Build Status](https://img.shields.io/github/workflow/status/sangwonl/python-mpegdash/Build%20Status?label=Python%202.7%2B%20builds)](https://github.com/sangwonl/python-mpegdash/actions?query=workflow%3A%22Build+Status%22)
[![License](https://img.shields.io/github/license/sangwonl/python-mpegdash?style=flat)](https://github.com/sangwonl/python-mpegdash/blob/master/LICENSE)
Expand All @@ -19,7 +19,6 @@ $ pip install mpegdash
## Test

```bash
$ python -m unittest discover
a-detiste marked this conversation as resolved.
Show resolved Hide resolved
$ python3 -m unittest discover
```

Expand Down
7 changes: 1 addition & 6 deletions mpegdash/parser.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
from urllib.request import urlopen
from xml.dom import minidom

# python3 support
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen

from mpegdash.nodes import MPEGDASH
from mpegdash.utils import parse_child_nodes, write_child_node
from mpegdash.prettyprinter import pretty_print
Expand Down
3 changes: 1 addition & 2 deletions mpegdash/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from past.builtins import unicode # python3 compat
from xml.dom import minidom

import re
Expand All @@ -19,7 +18,7 @@ def parse_child_nodes(xmlnode, tag_name, node_type):

nodes = []
for elem in elements:
if node_type in (unicode, str):
a-detiste marked this conversation as resolved.
Show resolved Hide resolved
if node_type is str:
node = xmlnode.firstChild.nodeValue
else:
node = node_type()
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
future
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
license="MIT",
zip_safe=False,
include_package_data=True,
install_requires=["future"],
url="https://github.com/sangwonl/python-mpegdash",
tests_require=["unittest2"],
test_suite="tests.my_module_suite",
classifiers=[
"Programming Language :: Python",
Expand Down
5 changes: 1 addition & 4 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
try:
import unittest
except ImportError:
import unittest2 as unittest
import unittest


def my_module_suite():
Expand Down
5 changes: 1 addition & 4 deletions tests/test_mpdtoxml.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
try:
import unittest
except ImportError:
import unittest2 as unittest
import unittest

from sys import version_info
from mpegdash.parser import MPEGDASHParser
Expand Down
5 changes: 1 addition & 4 deletions tests/test_xmltompd.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
try:
import unittest
except ImportError:
import unittest2 as unittest
import unittest

from mpegdash.parser import MPEGDASHParser

Expand Down