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

python 2.6 #27

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
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
8 changes: 5 additions & 3 deletions pymediainfo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def parse_xml_data_into_dom(xml_data):
@staticmethod
def parse(filename):
if os.name in ("nt", "dos", "os2", "ce"):
lib = windll.MediaInfo
lib = windll.MediaInfo
elif sys.platform == "darwin":
try:
lib = CDLL("libmediainfo.0.dylib")
Expand Down Expand Up @@ -96,7 +96,9 @@ def parse(filename):
# Fix for https://github.com/sbraz/pymediainfo/issues/22
# Python 2 does not change LC_CTYPE
# at startup: https://bugs.python.org/issue6203
if (sys.version_info.major < 3 and os.name == "posix"
version_major = sys.version_info[0] if type(sys.version_info) is tuple \
else sys.version_info.major
if (version_major < 3 and os.name == "posix"
and locale.getlocale() == (None, None)):
locale.setlocale(locale.LC_CTYPE, locale.getdefaultlocale())
lib.MediaInfo_Option(None, "Inform", "XML")
Expand All @@ -110,7 +112,7 @@ def parse(filename):
def _populate_tracks(self):
if self.xml_dom is None:
return
for xml_track in self.xml_dom.iter("track"):
for xml_track in self.xml_dom.getiterator("track"):
self._tracks.append(Track(xml_track))
@property
def tracks(self):
Expand Down