Skip to content

Commit e4ff70c

Browse files
minor fixes for micropython
1 parent 311a82a commit e4ff70c

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

microdot.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
import json
2-
import re
1+
try:
2+
import ujson as json
3+
except ImportError:
4+
import json
5+
try:
6+
import ure as re
7+
except ImportError:
8+
import re
39
try:
410
import usocket as socket
511
except ImportError:
@@ -49,7 +55,6 @@ def __init__(self, client_sock, client_addr):
4955
if line == '':
5056
break
5157
header, value = line.split(':', 1)
52-
header = header.title()
5358
value = value.strip()
5459
self.headers[header] = value
5560
if header == 'Content-Length':
@@ -146,7 +151,6 @@ def write(self, client_stream):
146151
content_length_found = False
147152
content_type_found = False
148153
for header, value in self.headers.items():
149-
header = header.title()
150154
values = value if isinstance(value, list) else [value]
151155
for value in values:
152156
client_stream.write('{header}: {value}\r\n'.format(

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
author_email='miguel.grinberg@gmail.com',
1616
description='Impossibly small web framework for MicroPython',
1717
long_description=__doc__,
18-
packages=['microdot'],
18+
py_modules=['microdot'],
1919
zip_safe=False,
2020
include_package_data=True,
2121
platforms='any',

0 commit comments

Comments
 (0)